WSL2-Linux-Kernel/drivers
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
..
accessibility
acpi ACPI: remove duplicated lines of merging problems with acpi_processor_add 2012-02-08 15:07:03 -08:00
amba
ata [libata] ata_piix: Add Toshiba Satellite Pro A120 to the quirks list 2012-01-17 20:50:53 -05:00
atm
auxdisplay
base driver-core: cpu: fix kobject warning when hotplugging a cpu 2012-02-08 15:11:17 -08:00
bcma bcma: connect the bcma bus suspend/resume to the bcma driver suspend/resume 2012-01-17 09:54:08 -05:00
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2012-02-02 15:47:33 -08:00
bluetooth
cdrom
char agp: fix scratch page cleanup 2012-01-26 18:36:48 +00:00
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma i.MX SDMA: Fix burstsize settings 2012-02-02 14:00:43 +05:30
edac
eisa
firewire firewire: ohci: disable MSI on Ricoh controllers 2012-01-30 21:33:34 +01:00
firmware
gpio gpio: Add missing spin_lock_init in gpio-ml-ioh driver 2012-02-01 21:59:37 -07:00
gpu drm/radeon/kms/blit: fix blit copy for very large buffers 2012-02-02 15:54:48 +00:00
hid HID: wiimote: fix invalid power_supply_powers call 2012-02-07 13:40:56 +01:00
hv
hwmon hwmon: (w83627ehf) Fix number of fans for NCT6776F 2012-02-04 18:08:23 -08:00
hwspinlock
i2c i2c: OMAP: Fix OMAP1 build error 2012-01-20 08:24:22 -08:00
ide
idle ACPI processor hotplug: Delay acpi_processor_start() call for hotplugged cores 2012-01-19 21:26:32 -05:00
ieee802154
infiniband IB/srpt: Don't return freed pointer from srpt_alloc_ioctx_ring() 2012-02-06 08:57:11 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2012-02-04 10:57:42 -08:00
iommu iommu/msm: Fix error handling in msm_iommu_unmap() 2012-01-30 12:53:14 +01:00
isdn
leds drivers/leds/leds-lm3530.c: fix setting pltfm->als_vmax 2012-02-08 19:03:51 -08:00
lguest
macintosh
mca
md Some simple md-related fixes. 2012-02-08 19:06:30 -08:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-01-26 17:04:47 -08:00
memstick
message
mfd mfd: Avoid twl6040-codec PLL reconfiguration when not needed 2012-02-03 19:03:50 +01:00
misc Minor char-misc fixes for 3.3-rc3 2012-02-09 13:51:13 -08:00
mmc drivers: misc: Remove MISC_DEVICES config option 2012-01-24 16:24:02 -08:00
mtd - Fix a regression in 16-bit Atmel NAND flash which was introduced in 3.1 2012-02-04 07:17:47 -08:00
net Minor char-misc fixes for 3.3-rc3 2012-02-09 13:51:13 -08:00
nfc
nubus
of
oprofile
parisc
parport
pci kernel-doc: fix new warnings in pci 2012-01-23 08:44:53 -08:00
pcmcia pcmcia: fix socket refcount decrementing on each resume 2012-02-08 19:03:51 -08:00
pinctrl pinctrl: add checks for empty function names 2012-01-26 14:13:11 +01:00
platform
pnp
power
pps
ps3
ptp
rapidio
regulator This fixes an integration issue with the regulator device tree bindings 2012-01-30 10:16:25 -08:00
rtc Revert "RTC: sa1100: remove redundant code of setting alarm" 2012-01-19 17:26:26 +00:00
s390 [S390] dasd: revalidate server for new pathgroup 2012-01-18 18:03:42 +01:00
sbus
scsi Staging: hv: storvsc: Move the storage driver out of the staging area 2012-02-13 11:35:20 -08:00
sfi
sh
sn
spi spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver 2012-02-05 23:24:17 -07:00
ssb
staging staging:iio:tsl2563 rewrite probe error handling 2012-03-07 13:36:45 -08:00
target target: Fix unsupported WRITE_SAME sense payload 2012-02-07 06:48:58 +00:00
tc
thermal thermal: Rename generate_netlink_event 2012-01-23 03:15:25 -05:00
tty drivers/tty/vt/vt_ioctl.c: fix KDFONTOP 32bit compatibility layer 2012-02-03 16:16:41 -08:00
uio
usb USB: usbserial: add new PID number (0xa951) to the ftdi driver 2012-02-03 11:22:44 -08:00
uwb
vhost
video fbdev fixes for 3.3 2012-02-07 15:54:02 -08:00
virt
virtio virtio: correct the memory barrier in virtqueue_kick_prepare() 2012-01-28 08:10:23 +10:30
vlynq
w1
watchdog watchdog: iTCO_wdt: add Intel Lynx Point DeviceIDs 2012-01-27 10:01:16 +01:00
xen xen/granttable: Disable grant v2 for HVM domains. 2012-01-27 11:14:16 -05:00
zorro
Kconfig telephony: Move to staging 2012-02-08 16:58:04 -08:00
Makefile staging: fix the build breakage cuased by telephony drivers 2012-02-09 09:07:46 -08:00