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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Aug 2017 21:23:30 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Kees Cook <keescook@...omium.org>,
        Tony Luck <tony.luck@...el.com>,
        kernel-janitors@...r.kernel.org
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 3/3] pstore: Adjust two checks for null pointers

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 16 Aug 2017 21:00:16 +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 affected source code places.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/pstore/ram.c      | 2 +-
 fs/pstore/ram_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 0ef95c384bed..38b81868f7f9 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -333,7 +333,7 @@ static ssize_t ramoops_pstore_read(struct pstore_record *record)
 	record->ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0);
 
 	record->buf = kmalloc(size + record->ecc_notice_size + 1, GFP_KERNEL);
-	if (record->buf == NULL) {
+	if (!record->buf) {
 		size = -ENOMEM;
 		goto out;
 	}
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 5d9f7280d757..e37b2d0cb9f4 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -223,7 +223,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
 	 */
 	prz->rs_decoder = init_rs(prz->ecc_info.symsize, prz->ecc_info.poly,
 				  0, 1, prz->ecc_info.ecc_size);
-	if (prz->rs_decoder == NULL) {
+	if (!prz->rs_decoder) {
 		pr_info("init_rs failed\n");
 		return -EINVAL;
 	}
-- 
2.14.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ