]> git.karo-electronics.de Git - linux-beck.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)
commit5d92f71e687e4e1a0bed489707d1ec58fe1100de
tree9d55fdba287db4a27318a4a6b514aa506f100036
parent099f5d01a6f73712e17552679aa724e021809a6e
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