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: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
988440e7e5
commit
b94badbb47
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue