usb: avoid NULL check before free
Subsystems (2)
PATCH 1/1 usb: avoid NULL check before free
The free() function checks if the argument is NULL. Do not duplicate this check.
Signed-off-by Heinrich Schuchardt <[email protected]>
--- drivers/usb/host/ehci-hcd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/usb/host/ehci-hcd.c +3 -6
@@ -1413,13 +1413,10 @@ static struct int_queue *_ehci_create_int_queue(struct usb_device *dev,debug ("Exit create_int_queue\n" );return result; fail3: -if (result->tds) -free (result->tds); +free (result->tds); fail2: -if (result->first) -free (result->first); -if (result) -free (result); +free (result->first); +free (result); fail1:return NULL ; }
--
2.25.1
Marek Vasut
AppliedPATCH 1/1 usb: avoid NULL check before free
Quoted 30 lines · Heinrich Schuchardt
The
free()function checks if the argument is NULL. Do not duplicate this check.Signed-off-by Heinrich Schuchardt <[email protected]>--- drivers/usb/host/ehci-hcd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)drivers/usb/host/ehci-hcd.c +3
-7@@ -1413,13 +1413,10 @@ static struct int_queue *_ehci_create_int_queue(struct usb_device *dev,debug ("Exit create_int_queue\n" );return result; fail3: -if (result->tds) -free (result->tds); +free (result->tds); fail2: -if (result->first) -free (result->first); -if (result) -free (result); +free (result->first); +free (result); fail1:return NULL ; } --
Quoted 1 line
2.25.1
Applied, thanks