]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wifi: wfx: Remove redundant NULL check before release_firmware() call
authorMinghao Chi <chi.minghao@zte.com.cn>
Mon, 6 Jun 2022 01:42:37 +0000 (01:42 +0000)
committerKalle Valo <kvalo@kernel.org>
Fri, 10 Jun 2022 07:38:55 +0000 (10:38 +0300)
release_firmware() checks for NULL pointers internally so checking
before calling it is redundant.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220606014237.290466-1-chi.minghao@zte.com.cn
drivers/net/wireless/silabs/wfx/fwio.c

index 3d1b8a135dc07603f54483bb18551cd962d16c27..52c7f560b062c6c0eb1a5b49888bf0dadcfe9327 100644 (file)
@@ -286,8 +286,7 @@ static int load_firmware_secure(struct wfx_dev *wdev)
 
 error:
        kfree(buf);
-       if (fw)
-               release_firmware(fw);
+       release_firmware(fw);
        if (ret)
                print_boot_status(wdev);
        return ret;