Bluetooth: Remove some pointless conditionals before kfree_skb()
authorWei Yongjun <yjwei@cn.fujitsu.com>
Wed, 25 Feb 2009 10:29:52 +0000 (18:29 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 27 Feb 2009 05:14:49 +0000 (06:14 +0100)
Remove some pointless conditionals before kfree_skb().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/cmtp/core.c
net/bluetooth/hci_core.c
net/bluetooth/l2cap.c

index c9cac7719efe757ddcbd5567f1d464ee4cf12f47..0073ec8495da2e1ff04ad1266a1f2a815a3cc10d 100644 (file)
@@ -126,8 +126,7 @@ static inline void cmtp_add_msgpart(struct cmtp_session *session, int id, const
 
        session->reassembly[id] = nskb;
 
-       if (skb)
-               kfree_skb(skb);
+       kfree_skb(skb);
 }
 
 static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *skb)
index ba78cc1eb8d9aaa8973c3a2395af86a98e71d4d6..cd061510b6bd8356140c428a1187235e87ed31dc 100644 (file)
@@ -1565,8 +1565,7 @@ static void hci_cmd_task(unsigned long arg)
 
        /* Send queued commands */
        if (atomic_read(&hdev->cmd_cnt) && (skb = skb_dequeue(&hdev->cmd_q))) {
-               if (hdev->sent_cmd)
-                       kfree_skb(hdev->sent_cmd);
+               kfree_skb(hdev->sent_cmd);
 
                if ((hdev->sent_cmd = skb_clone(skb, GFP_ATOMIC))) {
                        atomic_dec(&hdev->cmd_cnt);
index db6fbf129be064bfd96115d8f64731196aa33a96..ca4d3b40d5cea5ac310dafe77177499eab6e554a 100644 (file)
@@ -518,8 +518,7 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
 
        BT_DBG("hcon %p conn %p, err %d", hcon, conn, err);
 
-       if (conn->rx_skb)
-               kfree_skb(conn->rx_skb);
+       kfree_skb(conn->rx_skb);
 
        /* Kill channels */
        while ((sk = conn->chan_list.head)) {