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: <20220619070645.100947-1-jrdr.linux@gmail.com>
Date:   Sun, 19 Jun 2022 12:36:45 +0530
From:   Souptick Joarder <jrdr.linux@...il.com>
To:     martyn@...chs.me.uk, manohar.vanga@...il.com,
        gregkh@...uxfoundation.org, alexandre.belloni@...tlin.com,
        rafael@...nel.org, mathieu.poirier@...aro.org,
        u.kleine-koenig@...gutronix.de, arnd@...db.de
Cc:     linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev,
        "Souptick Joarder (HPE)" <jrdr.linux@...il.com>,
        Kernel test robot <lkp@...el.com>
Subject: [PATCH] vme: Added NULL check for bridge

From: "Souptick Joarder (HPE)" <jrdr.linux@...il.com>

Kernel test robot throws below warning ->
drivers/staging/vme_user/vme.c:662:20: warning: dereference
of NULL 'bridge' [CWE-476] [-Wanalyzer-null-dereference]

Added a NULL check.

Reported-by: Kernel test robot <lkp@...el.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@...il.com>
---
 drivers/staging/vme_user/vme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c
index b5555683a069..ede774f2fe5a 100644
--- a/drivers/staging/vme_user/vme.c
+++ b/drivers/staging/vme_user/vme.c
@@ -659,7 +659,7 @@ ssize_t vme_master_read(struct vme_resource *resource, void *buf, size_t count,
 	struct vme_master_resource *image;
 	size_t length;
 
-	if (!bridge->master_read) {
+	if (bridge && !bridge->master_read) {
 		printk(KERN_WARNING "Reading from resource not supported\n");
 		return -EINVAL;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ