* [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info()
@ 2025-08-15 6:49 Dan Carpenter
2025-08-18 12:12 ` Mark Brown
2025-08-19 19:47 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-08-15 6:49 UTC (permalink / raw)
To: Jeff Chang; +Cc: Liam Girdwood, Mark Brown, linux-kernel, kernel-janitors
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@linaro.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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info()
2025-08-15 6:49 [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info() Dan Carpenter
@ 2025-08-18 12:12 ` Mark Brown
2025-08-19 19:47 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-08-18 12:12 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Jeff Chang, Liam Girdwood, linux-kernel, kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 302 bytes --]
On Fri, Aug 15, 2025 at 09:49:46AM +0300, Dan Carpenter wrote:
> 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().
This doesn't apply against current code, please check and resend.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info()
2025-08-15 6:49 [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info() Dan Carpenter
2025-08-18 12:12 ` Mark Brown
@ 2025-08-19 19:47 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-08-19 19:47 UTC (permalink / raw)
To: Jeff Chang, Dan Carpenter; +Cc: Liam Girdwood, linux-kernel, kernel-janitors
On Fri, 15 Aug 2025 09:49:46 +0300, Dan Carpenter wrote:
> 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().
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/1] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info()
commit: f7f804633c91f0fbf03eefbae39eec2205191a82
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-19 19:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 6:49 [PATCH next] regulator: rt5133: Fix IS_ERR() vs NULL bug in rt5133_validate_vendor_info() Dan Carpenter
2025-08-18 12:12 ` Mark Brown
2025-08-19 19:47 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox