wireless, libertas: remove redundant NULL tests before calling release_firmware()
authorJesper Juhl <jj@chaosbits.net>
Mon, 9 Apr 2012 20:51:07 +0000 (22:51 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 12 Apr 2012 19:06:07 +0000 (15:06 -0400)
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>
drivers/net/wireless/libertas/if_cs.c
drivers/net/wireless/libertas/if_sdio.c
drivers/net/wireless/libertas/if_spi.c
drivers/net/wireless/libertas/main.c

index 234ee88dec95400f4e6fce337d6e500251a805f8..171a06b8879d9e842b4d84adb32d9520166c4b47 100644 (file)
@@ -951,10 +951,8 @@ out2:
 out1:
        pcmcia_disable_device(p_dev);
 out:
-       if (helper)
-               release_firmware(helper);
-       if (mainfw)
-               release_firmware(mainfw);
+       release_firmware(helper);
+       release_firmware(mainfw);
 
        lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
        return ret;
index 9804ebc892d46dab0171bb90f964391146825831..15bfe2f589f7c5ac0177b7218cf6db067d6f6e98 100644 (file)
@@ -751,10 +751,8 @@ success:
        ret = 0;
 
 out:
-       if (helper)
-               release_firmware(helper);
-       if (mainfw)
-               release_firmware(mainfw);
+       release_firmware(helper);
+       release_firmware(mainfw);
 
        lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
        return ret;
index 50b1ee7721e99254120c00722345f62e540d321b..7a5df4f4cb7c4580046c299f79a80d45f41e88e5 100644 (file)
@@ -1095,10 +1095,8 @@ static int if_spi_init_card(struct if_spi_card *card)
                goto out;
 
 out:
-       if (helper)
-               release_firmware(helper);
-       if (mainfw)
-               release_firmware(mainfw);
+       release_firmware(helper);
+       release_firmware(mainfw);
 
        lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
 
index 957681dede1776b1a9ee94ab87626bb9e0f9ee63..3b81b709bf9e33b412d99fd950d45cefe49aee2b 100644 (file)
@@ -1269,14 +1269,10 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
 
   fail:
        /* Failed */
-       if (*helper) {
-               release_firmware(*helper);
-               *helper = NULL;
-       }
-       if (*mainfw) {
-               release_firmware(*mainfw);
-               *mainfw = NULL;
-       }
+       release_firmware(*helper);
+       *helper = NULL;
+       release_firmware(*mainfw);
+       *mainfw = NULL;
 
        return -ENOENT;
 }