Skip to content

Commit b1fb068

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 7585b97 commit b1fb068

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎drivers/bluetooth/bfusb.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
257257

258258
if (hdr & 0x10) {
259259
BT_ERR("%s error in block", data->hdev->name);
260-
if (data->reassembly)
261-
kfree_skb(data->reassembly);
260+
kfree_skb(data->reassembly);
262261
data->reassembly = NULL;
263262
return -EIO;
264263
}

‎drivers/bluetooth/hci_h4.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ static int h4_close(struct hci_uart *hu)
102102

103103
skb_queue_purge(&h4->txq);
104104

105-
if (h4->rx_skb)
106-
kfree_skb(h4->rx_skb);
105+
kfree_skb(h4->rx_skb);
107106

108107
hu->priv = NULL;
109108
kfree(h4);

‎drivers/bluetooth/hci_ll.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ static int ll_close(struct hci_uart *hu)
163163
skb_queue_purge(&ll->tx_wait_q);
164164
skb_queue_purge(&ll->txq);
165165

166-
if (ll->rx_skb)
167-
kfree_skb(ll->rx_skb);
166+
kfree_skb(ll->rx_skb);
168167

169168
hu->priv = NULL;
170169

0 commit comments

Comments
 (0)