diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-08-27 18:05:08 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-02 17:39:50 -0400 |
commit | 9a52028e534b0567913a4144060e774891c00a37 (patch) | |
tree | 1f212db593d5269dfa89fbbc4536e4353f7d8a46 /drivers/net | |
parent | 667d41008eb8a0e1d495d6c0a6143b43fe587c98 (diff) |
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/net')
-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 04d7a251e3f0..8941919001bb 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) | |||
595 | if (ret < 0) { | 595 | if (ret < 0) { |
596 | lbs_pr_err("can't download helper at 0x%x, ret %d\n", | 596 | lbs_pr_err("can't download helper at 0x%x, ret %d\n", |
597 | sent, ret); | 597 | sent, ret); |
598 | goto done; | 598 | goto err_release; |
599 | } | 599 | } |
600 | 600 | ||
601 | if (count == 0) | 601 | if (count == 0) |
@@ -604,9 +604,8 @@ static int if_cs_prog_helper(struct if_cs_card *card) | |||
604 | sent += count; | 604 | sent += count; |
605 | } | 605 | } |
606 | 606 | ||
607 | err_release: | ||
607 | release_firmware(fw); | 608 | release_firmware(fw); |
608 | ret = 0; | ||
609 | |||
610 | done: | 609 | done: |
611 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); | 610 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); |
612 | return ret; | 611 | return ret; |
@@ -676,14 +675,8 @@ static int if_cs_prog_real(struct if_cs_card *card) | |||
676 | } | 675 | } |
677 | 676 | ||
678 | ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); | 677 | ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); |
679 | if (ret < 0) { | 678 | if (ret < 0) |
680 | lbs_pr_err("firmware download failed\n"); | 679 | lbs_pr_err("firmware download failed\n"); |
681 | goto err_release; | ||
682 | } | ||
683 | |||
684 | ret = 0; | ||
685 | goto done; | ||
686 | |||
687 | 680 | ||
688 | err_release: | 681 | err_release: |
689 | release_firmware(fw); | 682 | release_firmware(fw); |