projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d16d37b
)
usb: avoid NULL check before free
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Sun, 19 Apr 2020 10:02:28 +0000
(12:02 +0200)
committer
Marek Vasut
<marek.vasut+renesas@gmail.com>
Tue, 28 Apr 2020 11:52:52 +0000
(13:52 +0200)
The free() function checks if the argument is NULL.
Do not duplicate this check.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/usb/host/ehci-hcd.c
patch
|
blob
|
history
diff --git
a/drivers/usb/host/ehci-hcd.c
b/drivers/usb/host/ehci-hcd.c
index 1edb344d0fb22cfb97ee4c05d87a068ac772ce5c..a2a85db1e7b6b6e5de026e747de983b552e8c3e0 100644
(file)
--- a/
drivers/usb/host/ehci-hcd.c
+++ b/
drivers/usb/host/ehci-hcd.c
@@
-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;
}