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:	Sat, 14 Dec 2013 12:43:11 +0800
From:	Wei Yongjun <weiyj.lk@...il.com>
To:	eric.y.miao@...il.com, linux@....linux.org.uk,
	haojian.zhuang@...il.com
Cc:	yongjun_wei@...ndmicro.com.cn,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH -next] ARM: pxa: fix return value check in em_x270_sensor_init()

From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

In case of error, the function regulator_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
 arch/arm/mach-pxa/em-x270.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 6915a9f..339b422 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -971,9 +971,9 @@ static int em_x270_sensor_init(void)
 	gpio_direction_output(cam_reset, 0);
 
 	em_x270_camera_ldo = regulator_get(NULL, "vcc cam");
-	if (em_x270_camera_ldo == NULL) {
+	if (IS_ERR(em_x270_camera_ldo)) {
 		gpio_free(cam_reset);
-		return -ENODEV;
+		return PTR_ERR(em_x270_camera_ldo);
 	}
 
 	ret = regulator_enable(em_x270_camera_ldo);

--
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