Commit b94badbb authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Greg Kroah-Hartman

USB: Make usb_buffer_free() NULL-safe

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: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 988440e7
......@@ -762,6 +762,8 @@ void usb_buffer_free (
{
if (!dev || !dev->bus || !dev->bus->op || !dev->bus->op->buffer_free)
return;
if (!addr)
return;
dev->bus->op->buffer_free (dev->bus, size, addr, dma);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment