Skip to content

Commit 7585b97

Browse files
Wei Yongjunholtmann
authored andcommitted
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>
1 parent 2ae9a6b commit 7585b97

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎net/bluetooth/cmtp/core.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ static inline void cmtp_add_msgpart(struct cmtp_session *session, int id, const
126126

127127
session->reassembly[id] = nskb;
128128

129-
if (skb)
130-
kfree_skb(skb);
129+
kfree_skb(skb);
131130
}
132131

133132
static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *skb)

‎net/bluetooth/hci_core.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,8 +1565,7 @@ static void hci_cmd_task(unsigned long arg)
15651565

15661566
/* Send queued commands */
15671567
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);
15701569

15711570
if ((hdev->sent_cmd = skb_clone(skb, GFP_ATOMIC))) {
15721571
atomic_dec(&hdev->cmd_cnt);

‎net/bluetooth/l2cap.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,7 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
518518

519519
BT_DBG("hcon %p conn %p, err %d", hcon, conn, err);
520520

521-
if (conn->rx_skb)
522-
kfree_skb(conn->rx_skb);
521+
kfree_skb(conn->rx_skb);
523522

524523
/* Kill channels */
525524
while ((sk = conn->chan_list.head)) {

0 commit comments

Comments
 (0)