projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.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
|
blame
|
history
diff --git
a/drivers/usb/core/usb.c
b/drivers/usb/core/usb.c
index 184c24660a4c572b89fd4175d24314dd1fcb8f6c..ab766e0fe4ef3a6532a2efdea8d5452974cd0ee6 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);
}