media: si2165: Remove redundant NULL check before release_firmware() call
authorMinghao Chi <chi.minghao@zte.com.cn>
Mon, 6 Jun 2022 01:44:33 +0000 (02:44 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 29 Apr 2024 11:26:56 +0000 (12:26 +0100)
release_firmware() checks for NULL pointers internally so checking
before calling it is redundant.

Link: https://lore.kernel.org/linux-media/20220606014433.290667-1-chi.minghao@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/dvb-frontends/si2165.c

index 434d003bf397ccd7c49082efacc058f05fee25aa..013d423d3263561a21f681f0897696bebb591354 100644 (file)
@@ -513,10 +513,8 @@ static int si2165_upload_firmware(struct si2165_state *state)
        ret = 0;
        state->firmware_loaded = true;
 error:
-       if (fw) {
-               release_firmware(fw);
-               fw = NULL;
-       }
+       release_firmware(fw);
+       fw = NULL;
 
        return ret;
 }