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-next>] [day] [month] [year] [list]
Date:	Tue, 18 Mar 2014 11:41:42 +0100
From:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:	Mauro Carvalho Chehab <m.chehab@...sung.com>
Cc:	Archit Taneja <archit@...com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] v4l: ti-vpe: fix devm_ioremap_resource() return value checking

devm_ioremap_resource() returns a pointer to the remapped memory or
an ERR_PTR() encoded error code on failure.  Fix the checks inside
csc_create() and sc_create() accordingly.

Cc: Archit Taneja <archit@...com>
Cc: Hans Verkuil <hans.verkuil@...co.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
---
Compile tested only.

 drivers/media/platform/ti-vpe/csc.c |    4 ++--
 drivers/media/platform/ti-vpe/sc.c  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: b/drivers/media/platform/ti-vpe/csc.c
===================================================================
--- a/drivers/media/platform/ti-vpe/csc.c	2014-03-14 16:45:25.848724010 +0100
+++ b/drivers/media/platform/ti-vpe/csc.c	2014-03-18 11:01:36.595182833 +0100
@@ -187,9 +187,9 @@ struct csc_data *csc_create(struct platf
 	}
 
 	csc->base = devm_ioremap_resource(&pdev->dev, csc->res);
-	if (!csc->base) {
+	if (IS_ERR(csc->base)) {
 		dev_err(&pdev->dev, "failed to ioremap\n");
-		return ERR_PTR(-ENOMEM);
+		return csc->base;
 	}
 
 	return csc;
Index: b/drivers/media/platform/ti-vpe/sc.c
===================================================================
--- a/drivers/media/platform/ti-vpe/sc.c	2014-03-14 16:45:25.848724010 +0100
+++ b/drivers/media/platform/ti-vpe/sc.c	2014-03-18 11:02:09.555182273 +0100
@@ -302,9 +302,9 @@ struct sc_data *sc_create(struct platfor
 	}
 
 	sc->base = devm_ioremap_resource(&pdev->dev, sc->res);
-	if (!sc->base) {
+	if (IS_ERR(sc->base)) {
 		dev_err(&pdev->dev, "failed to ioremap\n");
-		return ERR_PTR(-ENOMEM);
+		return sc->base;
 	}
 
 	return sc;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ