1. 20 Dec, 2013 19 commits
  2. 19 Dec, 2013 8 commits
  3. 18 Dec, 2013 9 commits
  4. 17 Dec, 2013 4 commits
    • Bernd Porr's avatar
      staging: comedi: fix result of memdup_user for user chanlist · e56b1401
      Bernd Porr authored
      If the channel list is not set in userspace we get an error at
      PTR_ERR(async->cmd.chanlist). However, do_become_nonbusy(dev, s) cleans
      up this pointer which causes a kernel ooops. Setting the channel list in
      async to NULL and checking this in do_become_nonbusy prevents the oops.
      
      [Ian Abbott] Also do the same for the chanlist allocated in
      do_cmdtest_ioctl().
      Signed-off-by: default avatarBernd Porr <mail@berndporr.me.uk>
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e56b1401
    • Masanari Iida's avatar
      staging: keucr: Fix typo in keucr driver · b163970f
      Masanari Iida authored
      Correct spelling typo in comment and printk.
      Signed-off-by: default avatarMasanari Iida <standby24x7@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b163970f
    • Malcolm Priestley's avatar
      staging: vt6656: clean up CARDbSetMediaChannel. · 7387f438
      Malcolm Priestley authored
      White space and commented out code.
      
      Camel case clean up.
      pDevice -> priv
      uConnectionChannel -> connection_channel
      Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7387f438
    • Ian Abbott's avatar
      staging/comedi: bug fix for module usage count on device removal · 1363e4fb
      Ian Abbott authored
      When a dynamically created comedi device is being automatically removed
      by a call to `comedi_auto_unconfig()` from the lower level driver,
      `comedi_device_cleanup()` is called to perform the detachment from the
      lower level driver.  If the comedi device is open at the time,
      `dev->use_count` will be the the number of outstanding opens.  The
      function currently decrements the the module counts of the "comedi"
      module and the low-level driver module by this amount and reduces
      `dev->use_count` to zero.  There are various problems with this as the
      `release` file operation handler `comedi_close()` also decrements
      `dev->use_count` and decrements the module usage counts.  This means
      that `dev->use_count` and the module counts can end up negative.
      
      Also, the assumed one-to-one relationship between the file open count
      and the low-level module usage count is invalid and can get screwed up.
      We only want to stop the low-level module being unloaded while a comedi
      device using the module has an open file object.
      
      Also, there is no need to manipulate the module count of the core
      "comedi" module at all since the comedi module is the owner of the file
      operations structure and the system will not unload the module while
      there are open file objects using it.
      
      Correct the bugs and simplify as follows:
      
      1. Get rid of the module count manipulations of the core "comedi" module
      (`THIS_MODULE`) altogether.
      
      2. Don't alter `dev->use_count` in `comedi_device_cleanup()` as it
      should only be altered by the `open` and `release` file operation
      handlers `comedi_open()` and `comedi_close()`.
      
      3. Increment the low-level module count for the following reasons:
      
        a) In `comedi_open()` if the open count was zero and the comedi device
           is attached to the low-level driver.
        b) When the `COMEDI_DEVCONFIG` ioctl is used to manually attach an
           unattached comedi device to a low-level driver.  The open count
           will be greater than zero at this time.  The actual increment of
           the low-level module count is already done by
           `comedi_device_attach()`.
      
      4. Decrement the low-level module count for the following reasons:
      
        a) In `comedi_close()` if the open count was 1 and the comedi device
           is attached to the low-level driver.
        b) In `comedi_device_cleanup()` (called via `comedi_auto_unconfig()`
           --> `comedi_release_hardware_device()` -->
           `comedi_free_board_dev()` when the comedi device is automatically
           unconfigured due to action by the low-level driver) if the device
           was attached (which it should be) and open count was non-zero
           (greater than zero).
        c) When the `COMEDI_DEVCONFIG` ioctl is used to manually detach the
           comedi device from the low-level driver.  The open count will be
           greater than zero at this time.
      
      The open count should never go negative.  Parts 3 and 4 ensure that the
      low-level module usage count is incremented on entering the state where
      the comedi device is attached to the low-level driver AND the open count
      is greater than zero, and is decremented on leaving that state.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1363e4fb