lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200121092455.82983-1-chenzhou10@huawei.com>
Date:   Tue, 21 Jan 2020 17:24:55 +0800
From:   Chen Zhou <chenzhou10@...wei.com>
To:     <davem@...emloft.net>, <mhabets@...arflare.com>, <kuba@...nel.org>,
        <sergei.shtylyov@...entembedded.com>
CC:     <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <chenzhou10@...wei.com>
Subject: [PATCH -next v2] drivers: net: declance: fix comparing pointer to 0

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@...wei.com>
---
 drivers/net/ethernet/amd/declance.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c
index 6592a2d..7282ce5 100644
--- a/drivers/net/ethernet/amd/declance.c
+++ b/drivers/net/ethernet/amd/declance.c
@@ -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) =
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ