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  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:   Sun, 26 Nov 2017 11:17:25 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        Alexey Khoroshilov <khoroshilov@...ras.ru>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Bhumika Goyal <bhumirks@...il.com>,
        Colin Ian King <colin.king@...onical.com>,
        "Gustavo A. R. Silva" <garsilva@...eddedor.com>,
        Sudip Mukherjee <sudipm.mukherjee@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 1/4] video: sm501fb: Delete error messages for a failed memory
 allocation in two functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 26 Nov 2017 10:10:31 +0100

Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/video/fbdev/sm501fb.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 6f0a19501c6a..e8301c4e7d44 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1934,10 +1934,8 @@ static int sm501fb_probe(struct platform_device *pdev)
 	/* allocate our framebuffers */
 
 	info = kzalloc(sizeof(struct sm501fb_info), GFP_KERNEL);
-	if (!info) {
-		dev_err(dev, "failed to allocate state\n");
+	if (!info)
 		return -ENOMEM;
-	}
 
 	info->dev = dev = &pdev->dev;
 	platform_set_drvdata(pdev, info);
@@ -2121,16 +2119,12 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
 	/* backup copies in case chip is powered down over suspend */
 
 	par->store_fb = vmalloc(par->screen.size);
-	if (par->store_fb == NULL) {
-		dev_err(info->dev, "no memory to store screen\n");
+	if (!par->store_fb)
 		return -ENOMEM;
-	}
 
 	par->store_cursor = vmalloc(par->cursor.size);
-	if (par->store_cursor == NULL) {
-		dev_err(info->dev, "no memory to store cursor\n");
+	if (!par->store_cursor)
 		goto err_nocursor;
-	}
 
 	dev_dbg(info->dev, "suspending screen to %p\n", par->store_fb);
 	dev_dbg(info->dev, "suspending cursor to %p\n", par->store_cursor);
-- 
2.15.0

Powered by blists - more mailing lists