]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: android: timed_gpio: Fix resource leak in timed_gpio_probe error paths
authorAxel Lin <axel.lin@gmail.com>
Wed, 21 Mar 2012 01:24:57 +0000 (09:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Apr 2012 16:48:29 +0000 (09:48 -0700)
commitae1d8565e461e4d98d22c029c7cf1a965af607d0
tree9d55fdba287db4a27318a4a6b514aa506f100036
parente8a6a849c7482f9afbe20a3c14f0e22f1fa2bff6
Staging: android: timed_gpio: Fix resource leak in timed_gpio_probe error paths

If gpio_request fails, we need to free all allocated resources.
Current code uses wrong array index to access gpio_data array.
So current code actually frees gpio_data[i].gpio by j times.

This patch moves the error handling code to err_out and thus improves
readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/timed_gpio.c