linux/drivers/staging/iio
Grant Grundler dbf717fd9a staging:iio:tsl2563 rewrite probe error handling
tsl2563 probe function has two minor issues with it's error handling paths:
1) it is silent (did not report errors to dmesg)
2) did not return failure code (mixed up use of ret and err)

and two major issues:
3) goto fail2 would corrupt a free memory pool ("double free")
4) device registration failure did NOT cancel/flush delayed work.
   (and thus dereference a freed data structure later)

The "double free" is subtle and was introduced with this change:
    Author: Jonathan Cameron <jic23@cam.ac.uk>
    Date:   Mon Apr 18 12:58:55 2011 +0100
    staging:iio:tsl2563 take advantage of new iio_device_allocate private data.

Originally, chip was allocated seperately. Now it's appended to the
indio_dev by iio_allocate_device(sizeof(*chip)). So we only need one
kfree call as well (in iio_free_device()).

Gory details of tracking this down are here:
   http://crosbug.com/26819

Despite iio_device_registration failing, system can at least now boot.
Will follow up with a fix to "double register : in_intensity_both_raw"
error that is included in the bug report.

Signed-off-by: Grant Grundler <grundler@chromium.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-07 13:36:45 -08:00
..
Documentation drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
accel drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
adc staging: iio: Convert platform_drivers to use module_platform_driver 2012-03-02 16:35:39 -08:00
addac staging:iio: Use dev_pm_ops 2012-02-24 12:11:13 -08:00
cdc staging:iio: Rename IIO_EVENT_CODE_EXTRACT_NUM to IIO_EVENT_CODE_EXTRACT_CHAN 2012-02-13 20:10:32 -08:00
dac drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
dds staging:iio:dds:ad9834 unwind use of is_visible for attrs. 2012-02-09 10:06:05 -08:00
gyro staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
impedance-analyzer staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
imu staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
light staging:iio:tsl2563 rewrite probe error handling 2012-03-07 13:36:45 -08:00
magnetometer drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
meter drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
resolver Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging 2012-01-09 12:18:17 -08:00
trigger staging: iio: Convert platform_drivers to use module_platform_driver 2012-03-02 16:35:39 -08:00
Kconfig drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
Makefile staging:iio::hwmon interface client driver. 2012-02-24 12:10:03 -08:00
TODO
buffer.h staging:iio: Remove declaration for non existing function 2012-02-24 12:14:03 -08:00
consumer.h staging:iio:core add in kernel interface mapping and getting IIO channels. 2012-02-24 12:10:02 -08:00
driver.h staging:iio:core add in kernel interface mapping and getting IIO channels. 2012-02-24 12:10:02 -08:00
events.h staging:iio: Add missing event code extract macros 2012-02-13 20:10:32 -08:00
iio.h staging: iio: core: Introduce debugfs support, add support for direct register access 2012-03-02 16:35:39 -08:00
iio_core.h staging:iio: Factor out event handling into its own file 2012-02-09 10:05:06 -08:00
iio_core_trigger.h staging:iio:triggers Remove unecessary existence checks and return val 2011-11-26 16:30:30 -08:00
iio_dummy_evgen.c drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
iio_dummy_evgen.h staging:iio:dummy Add event support + fake event generator 2011-10-17 15:36:30 -07:00
iio_hwmon.c staging:iio::hwmon interface client driver. 2012-02-24 12:10:03 -08:00
iio_simple_dummy.c staging: iio: Use kcalloc instead of kzalloc to allocate array 2011-11-30 19:37:33 +09:00
iio_simple_dummy.h staging:iio:dummy Add buffered reading support 2011-10-17 15:36:30 -07:00
iio_simple_dummy_buffer.c staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
iio_simple_dummy_events.c staging:iio: header reorganization 2011-11-26 16:35:04 -08:00
industrialio-buffer.c iio: core: constitfy available_scan_mask 2012-02-24 12:14:04 -08:00
industrialio-core.c staging:iio: Fix compile error without CONFIG_DEBUG_FS 2012-03-07 13:26:52 -08:00
industrialio-event.c staging:iio:events: Remove obsolete documentation 2012-02-13 20:10:32 -08:00
industrialio-trigger.c Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging 2012-01-09 12:18:17 -08:00
inkern.c staging:iio:core add in kernel interface mapping and getting IIO channels. 2012-02-24 12:10:02 -08:00
kfifo_buf.c staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
kfifo_buf.h staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
machine.h staging:iio:core add in kernel interface mapping and getting IIO channels. 2012-02-24 12:10:02 -08:00
ring_hw.h staging:iio: replacing term ring with buffer in the IIO core. 2011-09-26 17:31:53 -07:00
ring_sw.c drivers:staging:iio Fix typos and comments in staging iio. 2012-03-02 16:33:52 -08:00
ring_sw.h staging:iio: Setup buffer access functions when allocating the buffer 2012-02-09 10:03:51 -08:00
sysfs.h staging:iio: header reorganization 2011-11-26 16:35:04 -08:00
trigger.h staging:iio: iio_trigger contains defunct owner field. Remove it. 2011-12-16 10:56:26 -08:00
trigger_consumer.h staging:iio: treewide rename iio_triggered_ring_* to iio_triggered_buffer_* 2011-09-26 17:31:52 -07:00
types.h staging:iio: move iio data return types into types.h for use by inkern 2012-02-24 12:10:03 -08:00