提交 a7b957a2 编写于 作者: J Jesper Juhl 提交者: John W. Linville

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: NJesper Juhl <jj@chaosbits.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 d144f536
...@@ -951,10 +951,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -951,10 +951,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
out1: out1:
pcmcia_disable_device(p_dev); pcmcia_disable_device(p_dev);
out: out:
if (helper) release_firmware(helper);
release_firmware(helper); release_firmware(mainfw);
if (mainfw)
release_firmware(mainfw);
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret; return ret;
......
...@@ -751,10 +751,8 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card) ...@@ -751,10 +751,8 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
ret = 0; ret = 0;
out: out:
if (helper) release_firmware(helper);
release_firmware(helper); release_firmware(mainfw);
if (mainfw)
release_firmware(mainfw);
lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
return ret; return ret;
......
...@@ -1095,10 +1095,8 @@ static int if_spi_init_card(struct if_spi_card *card) ...@@ -1095,10 +1095,8 @@ static int if_spi_init_card(struct if_spi_card *card)
goto out; goto out;
out: out:
if (helper) release_firmware(helper);
release_firmware(helper); release_firmware(mainfw);
if (mainfw)
release_firmware(mainfw);
lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err); lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
......
...@@ -1269,14 +1269,10 @@ int lbs_get_firmware(struct device *dev, const char *user_helper, ...@@ -1269,14 +1269,10 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
fail: fail:
/* Failed */ /* Failed */
if (*helper) { release_firmware(*helper);
release_firmware(*helper); *helper = NULL;
*helper = NULL; release_firmware(*mainfw);
} *mainfw = NULL;
if (*mainfw) {
release_firmware(*mainfw);
*mainfw = NULL;
}
return -ENOENT; return -ENOENT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册