hamradio: Delete unnecessary checks before the macro call “dev_kfree_skb”

The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the shown calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Markus Elfring 2019-08-21 21:48:46 +02:00 committed by David S. Miller
parent 038dab7efc
commit b7deac3197
2 changed files with 2 additions and 4 deletions

View File

@ -961,7 +961,6 @@ static int epp_close(struct net_device *dev)
parport_write_control(pp, 0); /* reset the adapter */ parport_write_control(pp, 0); /* reset the adapter */
parport_release(bc->pdev); parport_release(bc->pdev);
parport_unregister_device(bc->pdev); parport_unregister_device(bc->pdev);
if (bc->skb)
dev_kfree_skb(bc->skb); dev_kfree_skb(bc->skb);
bc->skb = NULL; bc->skb = NULL;
printk(KERN_INFO "%s: close epp at iobase 0x%lx irq %u\n", printk(KERN_INFO "%s: close epp at iobase 0x%lx irq %u\n",

View File

@ -475,7 +475,6 @@ static int hdlcdrv_close(struct net_device *dev)
if (s->ops && s->ops->close) if (s->ops && s->ops->close)
i = s->ops->close(dev); i = s->ops->close(dev);
if (s->skb)
dev_kfree_skb(s->skb); dev_kfree_skb(s->skb);
s->skb = NULL; s->skb = NULL;
s->opened = 0; s->opened = 0;