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]
Message-ID: <7be00642-75c6-f774-49f8-51a264b3404d@users.sourceforge.net>
Date:   Fri, 18 Aug 2017 21:08:42 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-mtd@...ts.infradead.org,
        David Woodhouse <dwmw2@...radead.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] jffs2: Adjust a null pointer check in two functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 18 Aug 2017 20:40:35 +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>
---
 fs/jffs2/nodemgmt.c | 3 +--
 fs/jffs2/security.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index a7bbe879cfc3..d5346ba782f7 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -242,8 +242,7 @@ int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize,
 
 static void jffs2_close_nextblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
-
-	if (c->nextblock == NULL) {
+	if (!c->nextblock) {
 		jffs2_dbg(1, "%s(): Erase block at 0x%08x has already been placed in a list\n",
 			  __func__, jeb->offset);
 		return;
diff --git a/fs/jffs2/security.c b/fs/jffs2/security.c
index c2332e30f218..9859b522721f 100644
--- a/fs/jffs2/security.c
+++ b/fs/jffs2/security.c
@@ -29,7 +29,7 @@ static int jffs2_initxattrs(struct inode *inode,
 	const struct xattr *xattr;
 	int err = 0;
 
-	for (xattr = xattr_array; xattr->name != NULL; xattr++) {
+	for (xattr = xattr_array; xattr->name; xattr++) {
 		err = do_jffs2_setxattr(inode, JFFS2_XPREFIX_SECURITY,
 					xattr->name, xattr->value,
 					xattr->value_len, 0);
-- 
2.14.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ