From: Grant Grundler Date: Mon, 5 Mar 2012 17:15:59 +0000 (-0800) Subject: staging:iio:tsl2563 rewrite probe error handling X-Git-Tag: v3.4-rc1~186^2~66 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbf717fd9a0d5fddd2dae3314a1e14842f4dc182;p=pandora-kernel.git 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 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 Acked-by: Jonathan Cameron Reviewed-by: Bryan Freed Reviewed-by: Benson Leung Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed