]> err.no Git - linux-2.6/commitdiff
[Bluetooth] Kill redundant NULL checks before kfree()
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 6 Aug 2005 10:36:47 +0000 (12:36 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 6 Aug 2005 10:36:47 +0000 (12:36 +0200)
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>
drivers/bluetooth/bpa10x.c
drivers/bluetooth/hci_usb.c

index 2771c861f185295e120270cc0ac63fd0131df201..f696da6f417b6439cae905488d1affff6a9378b4 100644 (file)
@@ -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);
 }
index e8bad41da37f8aeb3801c673477efea7a0df1a4e..319871ca9f9faec2f41e0f8272e5d552cd21f491 100644 (file)
@@ -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);
                }