From: Dan Carpenter Date: Thu, 14 Feb 2013 07:26:43 +0000 (+0300) Subject: generic-adc-battery: Fix forever loop in gab_remove() X-Git-Tag: v3.9-rc1~151^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64d26f225fefe06c870634e7bfe026a063e7f776;p=pandora-kernel.git generic-adc-battery: Fix forever loop in gab_remove() There is a forever loop calling iio_channel_release() because the "chan < " part of the "chan < ARRAY_SIZE()" is missing. This is in both the error handling on probe and also in the remove function. The other thing is that it's possible for some of the elements of the adc_bat->channel[chan] array to be an ERR_PTR(). I've changed them to be NULL instead. We're still not allowed to pass NULLs to iio_channel_release() so I've added a check. Finally, I removed an unused "chan = ARRAY_SIZE(gab_chan_name);" statement as a small cleanup. Signed-off-by: Dan Carpenter Signed-off-by: Anton Vorontsov --- Reading git-diff-tree failed