mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-21 18:14:48 +08:00
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>
This commit is contained in:
parent
d144f536e3
commit
a7b957a277
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user