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  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:   Sat, 25 Nov 2017 21:50:06 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Steve Glendinning <steve.glendinning@...well.net>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 5/5] video: smscufx: Adjust three checks for null pointers

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 25 Nov 2017 21:21:20 +0100
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/video/fbdev/smscufx.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
index 03d35429e1b9..d14604536e63 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -1081,7 +1081,7 @@ static int ufx_ops_open(struct fb_info *info, int user)
 
 	kref_get(&dev->kref);
 
-	if (fb_defio && (info->fbdefio == NULL)) {
+	if (fb_defio && !info->fbdefio) {
 		/* enable defio at last moment if not disabled by client */
 
 		struct fb_deferred_io *fbdefio;
@@ -1556,8 +1556,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
 	}
 
 	/* If everything else has failed, fall back to safe default mode */
-	if (default_vmode == NULL) {
-
+	if (!default_vmode) {
 		struct fb_videomode fb_vmode = {0};
 
 		/* Add the standard VESA modes to our modelist
@@ -1583,8 +1582,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
 	}
 
 	/* If we have good mode and no active clients */
-	if ((default_vmode != NULL) && (dev->fb_count == 0)) {
-
+	if (default_vmode && dev->fb_count == 0) {
 		fb_videomode_to_var(&info->var, default_vmode);
 		ufx_var_color_format(&info->var);
 
@@ -1594,10 +1592,9 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
 			(info->var.bits_per_pixel / 8);
 
 		result = ufx_realloc_framebuffer(dev, info);
-
-	} else
+	} else {
 		result = -EINVAL;
-
+	}
 error:
 	if (edid && (dev->edid != edid))
 		kfree(edid);
-- 
2.15.0

Powered by blists - more mailing lists