[PATCH] Don't test for NULL firmware before releasing

From: Jesper Juhl
Date: Wed Feb 15 2023 - 20:33:05 EST


release_firmware() tests for a NULL pointer itself, no need to do it up-front.

Signed-off-by: Jesper Juhl <jesperjuhl76@xxxxxxxxx>

---
drivers/gpu/drm/tegra/falcon.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/falcon.c b/drivers/gpu/drm/tegra/falcon.c
index c0d85463eb1a..ae599441f031 100644
--- a/drivers/gpu/drm/tegra/falcon.c
+++ b/drivers/gpu/drm/tegra/falcon.c
@@ -153,8 +153,7 @@ int falcon_init(struct falcon *falcon)

void falcon_exit(struct falcon *falcon)
{
- if (falcon->firmware.firmware)
- release_firmware(falcon->firmware.firmware);
+ release_firmware(falcon->firmware.firmware);
}

int falcon_boot(struct falcon *falcon)
--
2.39.2