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-prev] [day] [month] [year] [list]
Date:   Mon, 16 Oct 2017 14:20:47 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     "David S. Miller" <davem@...emloft.net>,
        Jarod Wilson <jarod@...hat.com>,
        Johannes Berg <johannes.berg@...el.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        kernel-janitors@...r.kernel.org
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 3/3] char/pcmcia: Adjust a null pointer check in three
 functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 16 Oct 2017 13:46:00 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/char/pcmcia/synclink_cs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 6c210b5cdf69..1719d929c0e4 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -2644,7 +2644,7 @@ static int rx_alloc_buffers(MGSLPC_INFO *info)
 	info->rx_buf_count = info->rx_buf_total_size / info->rx_buf_size;
 
 	info->rx_buf = kmalloc(info->rx_buf_total_size, GFP_KERNEL);
-	if (info->rx_buf == NULL)
+	if (!info->rx_buf)
 		return -ENOMEM;
 
 	/* unused flag buffer to satisfy receive_buf calling interface */
@@ -4228,7 +4228,7 @@ static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size)
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("hdlcdev_rx(%s)\n", dev->name);
 
-	if (skb == NULL) {
+	if (!skb) {
 		printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name);
 		dev->stats.rx_dropped++;
 		return;
@@ -4269,7 +4269,7 @@ static int hdlcdev_init(MGSLPC_INFO *info)
 	/* allocate and initialize network and HDLC layer objects */
 
 	dev = alloc_hdlcdev(info);
-	if (dev == NULL) {
+	if (!dev) {
 		printk(KERN_ERR "%s:hdlc device allocation failure\n", __FILE__);
 		return -ENOMEM;
 	}
-- 
2.14.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ