Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Remove some pointless conditionals before kfree_skb()

Remove some pointless conditionals before kfree_skb().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Wei Yongjun and committed by
Marcel Holtmann
7585b97a 2ae9a6be

+3 -6
+1 -2
net/bluetooth/cmtp/core.c
··· 126 126 127 127 session->reassembly[id] = nskb; 128 128 129 - if (skb) 130 - kfree_skb(skb); 129 + kfree_skb(skb); 131 130 } 132 131 133 132 static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *skb)
+1 -2
net/bluetooth/hci_core.c
··· 1565 1565 1566 1566 /* Send queued commands */ 1567 1567 if (atomic_read(&hdev->cmd_cnt) && (skb = skb_dequeue(&hdev->cmd_q))) { 1568 - if (hdev->sent_cmd) 1569 - kfree_skb(hdev->sent_cmd); 1568 + kfree_skb(hdev->sent_cmd); 1570 1569 1571 1570 if ((hdev->sent_cmd = skb_clone(skb, GFP_ATOMIC))) { 1572 1571 atomic_dec(&hdev->cmd_cnt);
+1 -2
net/bluetooth/l2cap.c
··· 518 518 519 519 BT_DBG("hcon %p conn %p, err %d", hcon, conn, err); 520 520 521 - if (conn->rx_skb) 522 - kfree_skb(conn->rx_skb); 521 + kfree_skb(conn->rx_skb); 523 522 524 523 /* Kill channels */ 525 524 while ((sk = conn->chan_list.head)) {