diff options
author | Jesper Juhl <jj@chaosbits.net> | 2012-04-09 16:51:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-12 15:06:07 -0400 |
commit | a7b957a277215da1830596c0791307a999fe5153 (patch) | |
tree | a5675f24770760ff356cf34fc0a43a4bba378cad /drivers/net/wireless/libertas | |
parent | d144f536e38a8e6fcd6e8e4c9035f107be9f7d62 (diff) |
wireless, libertas: remove redundant NULL tests before calling release_firmware()
release_firmware() tests for, and deals gracefully with, NULL
pointers. Remove redundant explicit tests before calling the function.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/if_cs.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/if_sdio.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/if_spi.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 12 |
4 files changed, 10 insertions, 20 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 234ee88dec9..171a06b8879 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -951,10 +951,8 @@ out2: | |||
951 | out1: | 951 | out1: |
952 | pcmcia_disable_device(p_dev); | 952 | pcmcia_disable_device(p_dev); |
953 | out: | 953 | out: |
954 | if (helper) | 954 | release_firmware(helper); |
955 | release_firmware(helper); | 955 | release_firmware(mainfw); |
956 | if (mainfw) | ||
957 | release_firmware(mainfw); | ||
958 | 956 | ||
959 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); | 957 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); |
960 | return ret; | 958 | return ret; |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 9804ebc892d..15bfe2f589f 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -751,10 +751,8 @@ success: | |||
751 | ret = 0; | 751 | ret = 0; |
752 | 752 | ||
753 | out: | 753 | out: |
754 | if (helper) | 754 | release_firmware(helper); |
755 | release_firmware(helper); | 755 | release_firmware(mainfw); |
756 | if (mainfw) | ||
757 | release_firmware(mainfw); | ||
758 | 756 | ||
759 | lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); | 757 | lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); |
760 | return ret; | 758 | return ret; |
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index 50b1ee7721e..7a5df4f4cb7 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c | |||
@@ -1095,10 +1095,8 @@ static int if_spi_init_card(struct if_spi_card *card) | |||
1095 | goto out; | 1095 | goto out; |
1096 | 1096 | ||
1097 | out: | 1097 | out: |
1098 | if (helper) | 1098 | release_firmware(helper); |
1099 | release_firmware(helper); | 1099 | release_firmware(mainfw); |
1100 | if (mainfw) | ||
1101 | release_firmware(mainfw); | ||
1102 | 1100 | ||
1103 | lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err); | 1101 | lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err); |
1104 | 1102 | ||
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 957681dede1..3b81b709bf9 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -1269,14 +1269,10 @@ int lbs_get_firmware(struct device *dev, const char *user_helper, | |||
1269 | 1269 | ||
1270 | fail: | 1270 | fail: |
1271 | /* Failed */ | 1271 | /* Failed */ |
1272 | if (*helper) { | 1272 | release_firmware(*helper); |
1273 | release_firmware(*helper); | 1273 | *helper = NULL; |
1274 | *helper = NULL; | 1274 | release_firmware(*mainfw); |
1275 | } | 1275 | *mainfw = NULL; |
1276 | if (*mainfw) { | ||
1277 | release_firmware(*mainfw); | ||
1278 | *mainfw = NULL; | ||
1279 | } | ||
1280 | 1276 | ||
1281 | return -ENOENT; | 1277 | return -ENOENT; |
1282 | } | 1278 | } |