diff options
author | Hemant Gupta <hemant.gupta@stericsson.com> | 2011-10-06 20:44:14 +0530 |
---|---|---|
committer | Robert Marklund <robert.marklund@stericsson.com> | 2011-10-27 16:08:31 +0200 |
commit | 73a054168842ccd0982bf9063e57c5a938f9f399 (patch) | |
tree | 319d375723632cda3c2c938bb2e9e6092a23a0ae /drivers | |
parent | d944dc79eb9bb82ac4ffe209a9ca61beaf455efd (diff) |
cg2900: Fix Memory Leak during Driver Init.
This patch fixes memory leak during driver initialization because
pmu gpio was never freed in case of failure in snowball initialization.
ST-Ericsson ID: 365769
ST-Ericcson FOSS-OUT-ID: Trivial
ST-Ericsson Linux next: 365769
Change-Id: Ic6ed3e172ca46ccf0da443272845de984f0f5706
Signed-off-by: Hemant Gupta <hemant.gupta@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33254
Reviewed-by: QABUILD
Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/cg2900/devices-cg2900.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/staging/cg2900/devices-cg2900.c b/drivers/staging/cg2900/devices-cg2900.c index 4a13094a955..a2bd2c92f9c 100644 --- a/drivers/staging/cg2900/devices-cg2900.c +++ b/drivers/staging/cg2900/devices-cg2900.c @@ -181,7 +181,7 @@ static int dcg2900_init(struct cg2900_chip_dev *dev) "%s: Failed to get regulator '%s'\n", __func__, pdata->regulator_id); info->regulator_wlan = NULL; - goto err_handling; + goto err_handling_free_gpios; } /* Enable it also */ err = regulator_enable(info->regulator_wlan); @@ -201,6 +201,14 @@ finished: return 0; err_handling_put_reg: regulator_put(info->regulator_wlan); +err_handling_free_gpios: + if (info->bt_gpio != -1) + gpio_free(info->bt_gpio); + if (info->pmuen_gpio != -1) + gpio_free(info->pmuen_gpio); + if (info->gbf_gpio != -1) + gpio_free(info->gbf_gpio); + err_handling: kfree(info); return err; |