diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-08-28 01:05:08 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-02 17:39:50 -0400 |
commit | 9a52028e534b0567913a4144060e774891c00a37 (patch) | |
tree | 1f212db593d5269dfa89fbbc4536e4353f7d8a46 /drivers | |
parent | 667d41008eb8a0e1d495d6c0a6143b43fe587c98 (diff) | |
download | op-kernel-dev-9a52028e534b0567913a4144060e774891c00a37.zip op-kernel-dev-9a52028e534b0567913a4144060e774891c00a37.tar.gz |
wireless/libertas/if_cs.c: fix memory leaks
The leak in if_cs_prog_helper() is obvious.
It looks a bit as if not freeing "fw" in if_cs_prog_real() was done
intentionally, but I'm not seeing why it shouldn't be freed.
Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/libertas/if_cs.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 04d7a25..8941919 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c @@ -595,7 +595,7 @@ static int if_cs_prog_helper(struct if_cs_card *card) if (ret < 0) { lbs_pr_err("can't download helper at 0x%x, ret %d\n", sent, ret); - goto done; + goto err_release; } if (count == 0) @@ -604,9 +604,8 @@ static int if_cs_prog_helper(struct if_cs_card *card) sent += count; } +err_release: release_firmware(fw); - ret = 0; - done: lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); return ret; @@ -676,14 +675,8 @@ static int if_cs_prog_real(struct if_cs_card *card) } ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); - if (ret < 0) { + if (ret < 0) lbs_pr_err("firmware download failed\n"); - goto err_release; - } - - ret = 0; - goto done; - err_release: release_firmware(fw); |