[<prev] [next>] [day] [month] [year] [list]
Message-ID: <aJ7YivhlWlE6ifw1@stanley.mountain>
Date: Fri, 15 Aug 2025 09:49:46 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Jeff Chang <jeff_chang@...htek.com>
Cc: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in
rt5133_validate_vendor_info()
The "priv->cdata" pointer isn't an error pointer, it should be a NULL
check instead. Otherwise it leads to a NULL pointer dereference in the
caller, rt5133_probe().
Fixes: 714165e1c4b0 ("regulator: rt5133: Add RT5133 PMIC regulator Support")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/regulator/rt5133-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/rt5133-regulator.c b/drivers/regulator/rt5133-regulator.c
index d0f367381fbb..a83a595c0609 100644
--- a/drivers/regulator/rt5133-regulator.c
+++ b/drivers/regulator/rt5133-regulator.c
@@ -510,7 +510,7 @@ static int rt5133_validate_vendor_info(struct rt5133_priv *priv)
break;
}
}
- if (IS_ERR(priv->cdata)) {
+ if (!priv->cdata) {
dev_err(priv->dev, "Failed to find regualtor match version\n");
return -ENODEV;
}
--
2.47.2
Powered by blists - more mailing lists