1. 20 Dec, 2013 16 commits
  2. 19 Dec, 2013 8 commits
  3. 18 Dec, 2013 9 commits
  4. 17 Dec, 2013 7 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
    • Ian Abbott's avatar
      staging/comedi: keep reference to class device after destroyed · 8f988d87
      Ian Abbott authored
      When a dynamically allocated `struct comedi_device` gets automatically
      unconfigured by a call to `comedi_auto_unconfig()` from a lower-level
      driver's bus removal function (e.g. when a USB device is disconnected),
      the class device in `dev->class_dev` (where `dev` points to the `struct
      comedi_device`) is destroyed by a call to `device_destroy()` that
      matches a previous call to `device_create()`.
      
      However, if the `struct comedi_device` is still associated with an open
      file object, the now invalid `dev->class_dev` pointer may still be
      passed to `dev_printk()` (via `dev_dbg()` etc.), producing bogus output
      or worse.
      
      To fix this, call `get_device()` on the class device if
      `device_create()` was successful.  Add a matching call to `put_device()`
      in `comedi_dev_kref_release()` when the `struct comedi_device` is freed.
      The calls to `dev_dbg()` etc. after the call to `device_destroy()` will
      still produce valid output, although the device will have been
      unregistered in sysfs.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8f988d87
    • Ivaylo Dimitrov's avatar
      Staging: TIDSPBRIDGE: Remove UUID helper · a3b22220
      Ivaylo Dimitrov authored
      Custom uuid helper function is needed only in rmgr/dbdcd.c and doesn't
      need to be exported. It can also be made way simpler by using sscanf.
      Signed-off-by: default avatarIvaylo Dimitrov <freemangordon@abv.bg>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a3b22220
    • Malcolm Priestley's avatar
      staging: vt6656: Remove unused scStatistic data/functions from driver. · 1fd4f55b
      Malcolm Priestley authored
      None of these stats reach user. So delete them from driver
      
      mib.c and mib.h becomes dead code as result of this patch.
      Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1fd4f55b