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:   Thu, 19 Dec 2019 15:48:56 +0800
From:   Chuhong Yuan <hslester96@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] media: omap3isp: fix the incorrect check in omap3isp_csiphy_acquire

The check in omap3isp_csiphy_acquire() does not check for ERR_PTR.
Besides, sometimes vdd can be optional and therefore NULL.
Revise the check to fix this issue.

Fixes: 121e9f1c4c49 ("[media] omap3isp: CCP2/CSI2 receivers")
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
 drivers/media/platform/omap3isp/ispcsiphy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c b/drivers/media/platform/omap3isp/ispcsiphy.c
index 6dc7359c5131..4f46d99a4228 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.c
+++ b/drivers/media/platform/omap3isp/ispcsiphy.c
@@ -261,10 +261,10 @@ int omap3isp_csiphy_acquire(struct isp_csiphy *phy, struct media_entity *entity)
 {
 	int rval;
 
-	if (phy->vdd == NULL) {
+	if (IS_ERR(phy->vdd)) {
 		dev_err(phy->isp->dev,
 			"Power regulator for CSI PHY not available\n");
-		return -ENODEV;
+		return PTR_ERR(phy->vdd);
 	}
 
 	mutex_lock(&phy->mutex);
-- 
2.24.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ