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>] [day] [month] [year] [list]
Date:   Wed, 14 Sep 2016 17:47:50 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     timur@...i.org, plagnioj@...osoft.com, tomi.valkeinen@...com
Cc:     linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] video: fbdev: fsl-diu-fb: Return value is not handled correctly

-Free memory mapping after mapping done.
-uninstall framebuffer after framebuffer intallation done.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 drivers/video/fbdev/fsl-diu-fb.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c
index fe00a07..12449b4 100644
--- a/drivers/video/fbdev/fsl-diu-fb.c
+++ b/drivers/video/fbdev/fsl-diu-fb.c
@@ -1715,8 +1715,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 	 */
 	if ((unsigned long)data & 31) {
 		dev_err(&pdev->dev, "misaligned allocation");
-		ret = -ENOMEM;
-		goto error;
+		return -ENOMEM;
 	}
 
 	spin_lock_init(&data->reg_lock);
@@ -1752,8 +1751,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 	data->diu_reg = of_iomap(np, 0);
 	if (!data->diu_reg) {
 		dev_err(&pdev->dev, "cannot map DIU registers\n");
-		ret = -EFAULT;
-		goto error;
+		return -EFAULT;
 	}
 
 	/* Get the IRQ of the DIU */
@@ -1762,7 +1760,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 	if (!data->irq) {
 		dev_err(&pdev->dev, "could not get DIU IRQ\n");
 		ret = -EINVAL;
-		goto error;
+		goto err_unmap;
 	}
 	data->monitor_port = monitor_port;
 
@@ -1797,7 +1795,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 			  data->diu_reg);
 	if (ret) {
 		dev_err(&pdev->dev, "could not claim irq\n");
-		goto error;
+		goto err_unmap;
 	}
 
 	for (i = 0; i < NUM_AOIS; i++) {
@@ -1826,7 +1824,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 error:
 	for (i = 0; i < NUM_AOIS; i++)
 		uninstall_fb(&data->fsl_diu_info[i]);
-
+err_unmap:
 	iounmap(data->diu_reg);
 
 	return ret;
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ