Skip to contentSkip to conversation

media: omap3isp: fix the incorrect check in omap3isp_csiphy_acquire

PATCH New Chuhong Yuan 1 participant 1 message Dec 19, 2019 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/media/platform/omap3isp/ispcsiphy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/omap3isp/ispcsiphy.c +2 -2
index 6dc7359c5131..4f46d99a4228 100644
@@ -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);
Signature · 1 line
2.24.0