net: nci: remove redundant null pointer check before kfree_skb
authorzhong jiang <zhongjiang@huawei.com>
Thu, 20 Sep 2018 09:37:44 +0000 (17:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Sep 2018 16:04:37 +0000 (09:04 -0700)
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>
net/nfc/nci/uart.c

index a66f102c6c0138cf9296cb32733354a4401a7fcd..4503937915add62e980d0111b44ee631ccd790d2 100644 (file)
@@ -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);