Skip to content

Commit

Permalink
[Bluetooth] Kill redundant NULL checks before kfree()
Browse files Browse the repository at this point in the history
There's no need to check for NULL before calling kfree() on a pointer.

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
holtmann committed Aug 6, 2005
1 parent dcc365d commit e9a3e67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 2 additions & 5 deletions drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 2 additions & 4 deletions drivers/bluetooth/hci_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e9a3e67

Please sign in to comment.