summaryrefslogtreecommitdiffstats
path: root/net/nfc/nci
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-20 11:37:44 +0200
committerDavid S. Miller <davem@davemloft.net>2018-09-21 18:04:37 +0200
commite3c3215e41f60f9debb17f920e4da7cb3a82a55b (patch)
tree60466f075deaf114add67aad44bf0971013a710f /net/nfc/nci
parentipv4: remove redundant null pointer check before kfree_skb (diff)
downloadlinux-e3c3215e41f60f9debb17f920e4da7cb3a82a55b.tar.xz
linux-e3c3215e41f60f9debb17f920e4da7cb3a82a55b.zip
net: nci: remove redundant null pointer check before kfree_skb
kfree_skb has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree_skb. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/nfc/nci')
-rw-r--r--net/nfc/nci/uart.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c
index a66f102c6c01..4503937915ad 100644
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@ -192,10 +192,8 @@ static void nci_uart_tty_close(struct tty_struct *tty)
if (!nu)
return;
- if (nu->tx_skb)
- kfree_skb(nu->tx_skb);
- if (nu->rx_skb)
- kfree_skb(nu->rx_skb);
+ kfree_skb(nu->tx_skb);
+ kfree_skb(nu->rx_skb);
skb_queue_purge(&nu->tx_q);