Commit b7deac31 authored by Markus Elfring's avatar Markus Elfring Committed by David S. Miller

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 038dab7e
...@@ -961,8 +961,7 @@ static int epp_close(struct net_device *dev) ...@@ -961,8 +961,7 @@ 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",
bc_drvname, dev->base_addr, dev->irq); bc_drvname, dev->base_addr, dev->irq);
......
...@@ -475,8 +475,7 @@ static int hdlcdrv_close(struct net_device *dev) ...@@ -475,8 +475,7 @@ 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;
return i; return i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment