lkml.org 
[lkml]   [2022]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] USB: serial: Remove redundant NULL check before release_firmware() call
Date
From: Minghao Chi <chi.minghao@zte.com.cn>

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>
---
drivers/usb/serial/mxuport.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c
index eb45a9b0005c..eb9090ab900f 100644
--- a/drivers/usb/serial/mxuport.c
+++ b/drivers/usb/serial/mxuport.c
@@ -1109,8 +1109,7 @@ static int mxuport_probe(struct usb_serial *serial,
*/
usb_set_serial_data(serial, (void *)id->driver_info);
out:
- if (fw_p)
- release_firmware(fw_p);
+ release_firmware(fw_p);
return err;
}

--
2.25.1

\
 
 \ /
  Last update: 2022-06-06 03:44    [W:0.033 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site