projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
988440e
)
USB: Make usb_buffer_free() NULL-safe
author
Dmitry Torokhov
<dtor@insightbb.com>
Wed, 2 Aug 2006 02:33:34 +0000
(22:33 -0400)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Wed, 27 Sep 2006 18:58:49 +0000
(11:58 -0700)
kfree() handles NULL arguments which is handy in error handling paths as one
does need to insert bunch of ifs. How about making usb_buffer_free() do the
same?
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/usb.c
patch
|
blob
|
history
diff --git
a/drivers/usb/core/usb.c
b/drivers/usb/core/usb.c
index
184c246
..
ab766e0
100644
(file)
--- a/
drivers/usb/core/usb.c
+++ b/
drivers/usb/core/usb.c
@@
-761,7
+761,9
@@
void usb_buffer_free (
)
{
if (!dev || !dev->bus || !dev->bus->op || !dev->bus->op->buffer_free)
- return;
+ return;
+ if (!addr)
+ return;
dev->bus->op->buffer_free (dev->bus, size, addr, dma);
}