1. 03 8月, 2015 1 次提交
  2. 21 6月, 2015 1 次提交
  3. 23 5月, 2015 1 次提交
  4. 17 5月, 2015 1 次提交
  5. 11 5月, 2015 1 次提交
  6. 09 4月, 2015 1 次提交
  7. 15 3月, 2015 1 次提交
    • M
      iio: core: Fix double free. · c1b03ab5
      Martin Fuzzey 提交于
      When an error occurred during event registration memory was freed twice
      resulting in kernel memory corruption and a crash in unrelated code.
      
      The problem was caused by
      	iio_device_unregister_eventset()
      	iio_device_unregister_sysfs()
      
      being called twice, once on the error path and then
      again via iio_dev_release().
      
      Fix this by making these two functions idempotent so they
      may be called multiple times.
      
      The problem was observed before applying
      	78b33216 iio:core: Handle error when mask type is not separate
      Signed-off-by: NMartin Fuzzey <mfuzzey@parkeon.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      c1b03ab5
  8. 30 1月, 2015 1 次提交
  9. 28 1月, 2015 4 次提交
  10. 06 1月, 2015 1 次提交
  11. 26 12月, 2014 1 次提交
  12. 12 12月, 2014 1 次提交
    • L
      iio: Move buffer registration to the core · 3e1b6c95
      Lars-Peter Clausen 提交于
      Originally device and buffer registration were kept as separate operations
      in IIO to allow to register two distinct sets of channels for buffered and
      non-buffered operations. This has since already been further restricted and
      the channel set registered for the buffer needs to be a subset of the
      channel set registered for the device. Additionally the possibility to not
      have a raw (or processed) attribute for a channel which was registered for
      the device was added a while ago. This means it is possible to not register
      any device level attributes for a channel even if it is registered for the
      device. Also if a channel's scan_index is set to -1 and the channel is
      registered for the buffer it is ignored.
      
      So in summary it means it is possible to register the same channel array for
      both the device and the buffer yet still end up with distinctive sets of
      channels for both of them. This makes the argument for having to have to
      manually register the channels for both the device and the buffer invalid.
      Considering that the vast majority of all drivers want to register the same
      set of channels for both the buffer and the device it makes sense to move
      the buffer registration into the core to avoid some boiler-plate code in the
      device driver setup path.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      3e1b6c95
  13. 22 11月, 2014 3 次提交
  14. 20 7月, 2014 1 次提交
  15. 03 5月, 2014 1 次提交
  16. 30 4月, 2014 2 次提交
  17. 17 3月, 2014 1 次提交
    • J
      iio:core: Fix bug in length of event info_mask and catch unhandled bits set in masks. · ef4b4856
      Jonathan Cameron 提交于
      The unhandled bits case was highlighted by smatch:
        CHECK   drivers/iio/industrialio-core.c
      drivers/iio/industrialio-core.c:719 iio_device_add_info_mask_type() error: buffer overflow 'iio_chan_info_postfix' 17 <= 31
        CC [M]  drivers/iio/industrialio-core.o
        CHECK   drivers/iio/industrialio-event.c
      drivers/iio/industrialio-event.c:327 iio_device_add_event() error: buffer overflow 'iio_ev_info_text' 3 <= 3
      
      The incorrect limit for the for_each_set_bit loop was noticed whilst fixing
      this other case.  Note that as we only have 3 possible entries a the moment
      and the value was set to 4, the bug would not have any effect currently.
      It will bite fairly soon though, so best fix it now.
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      ef4b4856
  18. 15 3月, 2014 1 次提交
  19. 18 2月, 2014 3 次提交
  20. 04 12月, 2013 1 次提交
  21. 25 11月, 2013 2 次提交
  22. 24 10月, 2013 2 次提交
  23. 12 10月, 2013 5 次提交
  24. 01 10月, 2013 1 次提交
  25. 21 9月, 2013 2 次提交
    • L
      iio: Prevent race between IIO chardev opening and IIO device free · 0d5b7dae
      Lars-Peter Clausen 提交于
      Set the IIO device as the parent for the character device
      
      We need to make sure that the IIO device is not freed while the character device
      exists, otherwise the freeing of the IIO device might race against the file open
      callback. Do this by setting the character device's parent to the IIO device,
      this will cause the character device to grab a reference to the IIO device and
      only release it once the character device itself has been removed.
      
      Also move the registration of the character device before the registration of
      the IIO device to avoid the (rather theoretical case) that the IIO device is
      already freed again before we can add the character device and grab a reference
      to the IIO device.
      
      We also need to move the call to cdev_del() from iio_dev_release() to
      iio_device_unregister() (where it should have been in the first place anyway) to
      avoid a reference cycle. As iio_dev_release() is only called once all reference
      are dropped, but the character device holds a reference to the IIO device.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      0d5b7dae
    • L
      iio: fix: Keep a reference to the IIO device for open file descriptors · cadc2125
      Lars-Peter Clausen 提交于
      Make sure that the IIO device is not freed while we still have file descriptors
      for it.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      cadc2125