diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2019-08-21 21:48:46 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-22 16:22:03 -0700 |
commit | b7deac31979bd09c69e0e6e064609fad55df35be (patch) | |
tree | fe8485ecbc691daec727b18ba4d7f8b3b5b0f209 | |
parent | 038dab7efc38254e151adbbade13b8860055d44a (diff) | |
download | blackbird-op-linux-b7deac31979bd09c69e0e6e064609fad55df35be.tar.gz blackbird-op-linux-b7deac31979bd09c69e0e6e064609fad55df35be.zip |
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>
-rw-r--r-- | drivers/net/hamradio/baycom_epp.c | 3 | ||||
-rw-r--r-- | drivers/net/hamradio/hdlcdrv.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 9303aeb2595f..4476491b58f9 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -961,8 +961,7 @@ static int epp_close(struct net_device *dev) parport_write_control(pp, 0); /* reset the adapter */ parport_release(bc->pdev); parport_unregister_device(bc->pdev); - if (bc->skb) - dev_kfree_skb(bc->skb); + dev_kfree_skb(bc->skb); bc->skb = NULL; printk(KERN_INFO "%s: close epp at iobase 0x%lx irq %u\n", bc_drvname, dev->base_addr, dev->irq); diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index c6f83e0df0a3..df495b5595f5 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c @@ -475,8 +475,7 @@ static int hdlcdrv_close(struct net_device *dev) if (s->ops && s->ops->close) i = s->ops->close(dev); - if (s->skb) - dev_kfree_skb(s->skb); + dev_kfree_skb(s->skb); s->skb = NULL; s->opened = 0; return i; |