mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 22:51:35 +00:00
[Bluetooth] Kill redundant NULL checks before kfree()
There's no need to check for NULL before calling kfree() on a pointer. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
dcc365d8f2
commit
e9a3e671c0
@ -367,11 +367,8 @@ static inline void bpa10x_free_urb(struct urb *urb)
|
||||
if (!urb)
|
||||
return;
|
||||
|
||||
if (urb->setup_packet)
|
||||
kfree(urb->setup_packet);
|
||||
|
||||
if (urb->transfer_buffer)
|
||||
kfree(urb->transfer_buffer);
|
||||
kfree(urb->setup_packet);
|
||||
kfree(urb->transfer_buffer);
|
||||
|
||||
usb_free_urb(urb);
|
||||
}
|
||||
|
@ -390,10 +390,8 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
|
||||
urb = &_urb->urb;
|
||||
BT_DBG("%s freeing _urb %p type %d urb %p",
|
||||
husb->hdev->name, _urb, _urb->type, urb);
|
||||
if (urb->setup_packet)
|
||||
kfree(urb->setup_packet);
|
||||
if (urb->transfer_buffer)
|
||||
kfree(urb->transfer_buffer);
|
||||
kfree(urb->setup_packet);
|
||||
kfree(urb->transfer_buffer);
|
||||
_urb_free(_urb);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user