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]
Message-ID: <a1686dac-ad24-e46e-c1fc-64f897b458ff@users.sourceforge.net>
Date:   Sat, 16 Sep 2017 20:31:42 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-media@...r.kernel.org, Antti Palosaari <crope@....fi>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 1/2] [media] it913x: Delete two error messages for a failed
 memory allocation in it913x_probe()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 16 Sep 2017 19:40:47 +0200

* Omit extra messages for a memory allocation failure in this function.

  This issue was detected by using the Coccinelle software.

* Delete the label "err" and the variable "ret" which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/media/tuners/it913x.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c
index 27e5bc1c3cb5..6af9507823fa 100644
--- a/drivers/media/tuners/it913x.c
+++ b/drivers/media/tuners/it913x.c
@@ -392,14 +392,10 @@ static int it913x_probe(struct platform_device *pdev)
 	struct it913x_dev *dev;
 	const struct platform_device_id *id = platform_get_device_id(pdev);
-	int ret;
 	char *chip_ver_str;
 
 	dev = kzalloc(sizeof(struct it913x_dev), GFP_KERNEL);
-	if (dev == NULL) {
-		ret = -ENOMEM;
-		dev_err(&pdev->dev, "kzalloc() failed\n");
-		goto err;
-	}
+	if (!dev)
+		return -ENOMEM;
 
 	dev->pdev = pdev;
 	dev->regmap = pdata->regmap;
@@ -423,9 +419,6 @@ static int it913x_probe(struct platform_device *pdev)
 		 chip_ver_str);
 	dev_dbg(&pdev->dev, "chip_ver %u, role %u\n", dev->chip_ver, dev->role);
 	return 0;
-err:
-	dev_dbg(&pdev->dev, "failed %d\n", ret);
-	return ret;
 }
 
 static int it913x_remove(struct platform_device *pdev)
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ