diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 234ee88dec95400f4e6fce337d6e500251a805f8..171a06b8879d9e842b4d84adb32d9520166c4b47 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c @@ -951,10 +951,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) 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; diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 9804ebc892d46dab0171bb90f964391146825831..15bfe2f589f7c5ac0177b7218cf6db067d6f6e98 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c @@ -751,10 +751,8 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card) 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; diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index 50b1ee7721e99254120c00722345f62e540d321b..7a5df4f4cb7c4580046c299f79a80d45f41e88e5 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) 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); diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 957681dede1776b1a9ee94ab87626bb9e0f9ee63..3b81b709bf9e33b412d99fd950d45cefe49aee2b 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, 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; }