提交 b94badbb 编写于 作者: D Dmitry Torokhov 提交者: 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: NDmitry Torokhov <dtor@mail.ru>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册