02 Aug, 2010

7 commits


03 Jun, 2010

3 commits

  • Error handling code following a kmalloc should free the allocated data.

    The semantic match that finds the problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    statement S;
    expression E;
    identifier f,f1,l;
    position p1,p2;
    expression *ptr != NULL;
    @@

    x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
    ...
    if (x == NULL) S
    }
    (
    x->f1 = E
    |
    (x->f1 == NULL || ...)
    |
    f(...,x->f1,...)
    )
    ...>
    (
    return \(0\|\|ptr\);
    |
    return@p2 ...;
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David Woodhouse

    Julia Lawall
     
  • Fixes build errors in drivers caused by the OF device_node
    pointer being moved into struct device

    Signed-off-by: Anatolij Gustschin
    Signed-off-by: David Woodhouse

    Anatolij Gustschin
     
  • Move MTD_NAND_ECC and MTD_NAND_ECC_SMC above NAND memuconfig, to unbreak
    display in xconfig. This shouldn't change any dependencies.

    Signed-off-by: Maxim Levitsky
    Signed-off-by: David Woodhouse

    Maxim Levitsky
     

02 Jun, 2010

3 commits

  • This turns out to be the reason for DMA timeouts on resume,
    if card was inserted while system was suspended

    Signed-off-by: Maxim Levitsky
    Signed-off-by: David Woodhouse

    Maxim Levitsky
     
  • * Don't call complete on dma completion
    * do a INIT_COMPLETE before using it each time
    * Report DMA read error via ecc 'correct'

    I finally managed to make my system do suspend to ram propertly, and I see that
    if card was inserted during suspend (while system was off), I get dma timeouts
    on resume. Simple card reinsert solves the issue.
    This patch solves a crash that would happen otherwise

    Signed-off-by: Maxim Levitsky
    Signed-off-by: David Woodhouse

    Maxim Levitsky
     
  • Otherwise, if it fires right away, it might access
    uninitialized spinlock

    Signed-off-by: Maxim Levitsky
    Signed-off-by: David Woodhouse

    Maxim Levitsky
     

22 May, 2010

1 commit

  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David Woodhouse

    Julia Lawall
     

21 May, 2010

26 commits

  • * git://git.infradead.org/mtd-2.6: (154 commits)
    mtd: cfi_cmdset_0002: use AMD standard command-set with Winbond flash chips
    mtd: cfi_cmdset_0002: Fix MODULE_ALIAS and linkage for new 0701 commandset ID
    mtd: mxc_nand: Remove duplicate NAND_CMD_RESET case value
    mtd: update gfp/slab.h includes
    jffs2: Stop triggering block erases from jffs2_write_super()
    jffs2: Rename jffs2_erase_pending_trigger() to jffs2_dirty_trigger()
    jffs2: Use jffs2_garbage_collect_trigger() to trigger pending erases
    jffs2: Require jffs2_garbage_collect_trigger() to be called with lock held
    jffs2: Wake GC thread when there are blocks to be erased
    jffs2: Erase pending blocks in GC pass, avoid invalid -EIO return
    jffs2: Add 'work_done' return value from jffs2_erase_pending_blocks()
    mtd: mtdchar: Do not corrupt backing device of device node inode
    mtd/maps/pcmciamtd: Fix printk format for ssize_t in debug messages
    drivers/mtd: Use kmemdup
    mtd: cfi_cmdset_0002: Fix argument order in bootloc warning
    mtd: nand: add Toshiba TC58NVG0 device ID
    pcmciamtd: add another ID
    pcmciamtd: coding style cleanups
    pcmciamtd: fixing obvious errors
    mtd: chips: add SST39WF160x NOR-flashes
    ...

    Trivial conflicts due to dev_node removal in drivers/mtd/maps/pcmciamtd.c

    Linus Torvalds
     
  • * 'linux-next' of git://git.infradead.org/ubi-2.6:
    UBI: misc comment fixes
    UBI: fix s/then/than/ typos
    UBI: init even if MTD device cannot be attached, if built into kernel
    UBI: remove reboot notifier

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (182 commits)
    [SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
    [SCSI] aacraid: prohibit access to array container space
    [SCSI] aacraid: add support for handling ATA pass-through commands.
    [SCSI] aacraid: expose physical devices for models with newer firmware
    [SCSI] aacraid: respond automatically to volumes added by config tool
    [SCSI] fcoe: fix fcoe module ref counting
    [SCSI] libfcoe: FIP Keep-Alive messages for VPorts are sent with incorrect port_id and wwn
    [SCSI] libfcoe: Fix incorrect MAC address clearing
    [SCSI] fcoe: fix a circular locking issue with rtnl and sysfs mutex
    [SCSI] libfc: Move the port_id into lport
    [SCSI] fcoe: move link speed checking into its own routine
    [SCSI] libfc: Remove extra pointer check
    [SCSI] libfc: Remove unused fc_get_host_port_type
    [SCSI] fcoe: fixes wrong error exit in fcoe_create
    [SCSI] libfc: set seq_id for incoming sequence
    [SCSI] qla2xxx: Updates to ISP82xx support.
    [SCSI] qla2xxx: Optionally disable target reset.
    [SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
    [SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.
    [SCSI] qla2xxx: T10 DIF support added.
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (229 commits)
    USB: remove unused usb_buffer_alloc and usb_buffer_free macros
    usb: musb: update gfp/slab.h includes
    USB: ftdi_sio: fix legacy SIO-device header
    USB: kl5usb105: reimplement using generic framework
    USB: kl5usb105: minor clean ups
    USB: kl5usb105: fix memory leak
    USB: io_ti: use kfifo to implement write buffering
    USB: io_ti: remove unsused private counter
    USB: ti_usb: use kfifo to implement write buffering
    USB: ir-usb: fix incorrect write-buffer length
    USB: aircable: fix incorrect write-buffer length
    USB: safe_serial: straighten out read processing
    USB: safe_serial: reimplement read using generic framework
    USB: safe_serial: reimplement write using generic framework
    usb-storage: always print quirks
    USB: usb-storage: trivial debug improvements
    USB: oti6858: use port write fifo
    USB: oti6858: use kfifo to implement write buffering
    USB: cypress_m8: use kfifo to implement write buffering
    USB: cypress_m8: remove unused drain define
    ...

    Fix up conflicts (due to usb_buffer_alloc/free renaming) in
    drivers/input/tablet/acecad.c
    drivers/input/tablet/kbtab.c
    drivers/input/tablet/wacom_sys.c
    drivers/media/video/gspca/gspca.c
    sound/usb/usbaudio.c

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
    qlcnic: adding co maintainer
    ixgbe: add support for active DA cables
    ixgbe: dcb, do not tag tc_prio_control frames
    ixgbe: fix ixgbe_tx_is_paused logic
    ixgbe: always enable vlan strip/insert when DCB is enabled
    ixgbe: remove some redundant code in setting FCoE FIP filter
    ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
    ixgbe: fix header len when unsplit packet overflows to data buffer
    ipv6: Never schedule DAD timer on dead address
    ipv6: Use POSTDAD state
    ipv6: Use state_lock to protect ifa state
    ipv6: Replace inet6_ifaddr->dead with state
    cxgb4: notify upper drivers if the device is already up when they load
    cxgb4: keep interrupts available when the ports are brought down
    cxgb4: fix initial addition of MAC address
    cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
    cnic: Convert cnic_local_flags to atomic ops.
    can: Fix SJA1000 command register writes on SMP systems
    bridge: fix build for CONFIG_SYSFS disabled
    ARCNET: Limit com20020 PCI ID matches for SOHARD cards
    ...

    Fix up various conflicts with pcmcia tree drivers/net/
    {pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
    wireless/orinoco/spectrum_cs.c} and feature removal
    (Documentation/feature-removal-schedule.txt).

    Also fix a non-content conflict due to pm_qos_requirement getting
    renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c

    Linus Torvalds
     
  • * 'viafb-next' of git://git.lwn.net/linux-2.6: (35 commits)
    viafb: move some include files to include/linux
    viafb: Eliminate some global.h references
    viafb: get rid of i2c debug cruft
    viafb: fold via_io.h into via-core.h
    viafb: Fix initialization error paths
    viafb: Do not remove gpiochip under spinlock
    viafb: make procfs entries optional
    viafb: fix proc entry removal
    viafb: improve misc register handling
    viafb: replace inb/outb
    viafb: move some modesetting functions to a seperate file
    viafb: unify modesetting functions
    viafb: Reserve framebuffer memory for the upcoming camera driver
    viafb: Add a simple VX855 DMA engine driver
    viafb: Add a simple interrupt management infrastructure
    via: Rationalize vt1636 detection
    viafb: Introduce viafb_find_i2c_adapter()
    via: Do not attempt I/O on inactive I2C adapters
    viafb: Turn GPIO and i2c into proper platform devices
    viafb: Convert GPIO and i2c to the new indexed port ops
    ...

    Linus Torvalds
     
  • Implicit slab.h inclusion via percpu.h is about to go away. Make sure
    gfp.h or slab.h is included as necessary.

    Signed-off-by: Tejun Heo
    Cc: Stephen Rothwell
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • Length field of header was incorrectly set to available payload space
    rather than the actual payload size.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Kill custom read and write implementations (static per-port,
    singleton(!) urb pool).

    Also remove changelog header (can be retrieved through git).

    Read processing and write-buffer handling tested using a cp210x device
    in a loopback setup.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Whitespace changes and some removed comments.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Private data was not freed on error path in startup.

    Cc: stable
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Kill custom fifo implementation.

    Compile-only tested.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Kill custom fifo implementation.

    Compile-only tested.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Returned length should include header length.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Returned length should include header length.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Clean up read processing logic.

    Tested using a cp210x device in a loopback setup.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Use process_read_urb to implement read processing.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Kill custom single-urb write implementation.

    Note that this driver still depended on the write callback from the old
    generic framework.

    Tested against original read processing using a cp210x device in a
    loopback setup.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Right now quirks are printed only when the are manually overriden with
    the module parameters. It's not so useful to remind the user that his
    parameters are correctly applied; what is useful is to print out the
    quirks the user is not aware are being applied.

    So let's do the smart thing and print the quirks when they are present.

    Signed-off-by: Felipe Contreras
    Cc: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Felipe Contreras
     
  • Use pr_foo and dev_foo instead of printk. Maybe US_DEBUG* should be
    replaced too.

    Signed-off-by: Felipe Contreras
    Cc: Matthew Dharm
    Cc: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Felipe Contreras
     
  • Kill private write fifo and use port fifo instead (protected under
    port lock).

    Compile-only tested.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Kill custom fifo implementation.

    Use private write fifo to minimise changes to lock handling.

    Compile-only tested.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Kill custom fifo implementation.

    Note that cypress_m8 has no port write fifo as it has no bulk-out
    endpoint.

    Compile-only tested.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Driver uses tty-port drain these days.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Use bulk_out_size in usb_serial_driver to set urb buffer size.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold