Skip to content

Commit

Permalink
drivers: net: declance: fix comparing pointer to 0
Browse files Browse the repository at this point in the history
Fixes coccicheck warning:

./drivers/net/ethernet/amd/declance.c:611:14-15:
	WARNING comparing pointer to 0

Replace "skb == 0" with "!skb".

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chen Zhou authored and David S. Miller committed Jan 21, 2020
1 parent aeaec7b commit d84b99f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/amd/declance.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ static int lance_rx(struct net_device *dev)
len = (*rds_ptr(rd, mblength, lp->type) & 0xfff) - 4;
skb = netdev_alloc_skb(dev, len + 2);

if (skb == 0) {
if (!skb) {
dev->stats.rx_dropped++;
*rds_ptr(rd, mblength, lp->type) = 0;
*rds_ptr(rd, rmd1, lp->type) =
Expand Down

0 comments on commit d84b99f

Please sign in to comment.