* [PATCH next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe()
@ 2024-11-20 17:18 Dan Carpenter
2024-11-29 17:05 ` Duje Mihanović
2024-12-03 20:01 ` Stephen Boyd
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-11-20 17:18 UTC (permalink / raw)
To: Duje Mihanović
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
kernel-janitors
The devm_kzalloc() function returns NULL on error, not error pointers.
Update the check to match.
Fixes: ebac87cdd230 ("clk: mmp: Add Marvell PXA1908 MPMU driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/clk/mmp/clk-pxa1908-mpmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/mmp/clk-pxa1908-mpmu.c b/drivers/clk/mmp/clk-pxa1908-mpmu.c
index e3337bacaadd..90b4b2488574 100644
--- a/drivers/clk/mmp/clk-pxa1908-mpmu.c
+++ b/drivers/clk/mmp/clk-pxa1908-mpmu.c
@@ -78,8 +78,8 @@ static int pxa1908_mpmu_probe(struct platform_device *pdev)
struct pxa1908_clk_unit *pxa_unit;
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
- if (IS_ERR(pxa_unit))
- return PTR_ERR(pxa_unit);
+ if (!pxa_unit)
+ return -ENOMEM;
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pxa_unit->base))
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe()
2024-11-20 17:18 [PATCH next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe() Dan Carpenter
@ 2024-11-29 17:05 ` Duje Mihanović
2024-12-03 20:01 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Duje Mihanović @ 2024-11-29 17:05 UTC (permalink / raw)
To: Dan Carpenter
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
kernel-janitors
On Wednesday 20 November 2024 18:18:50 Central European Standard Time Dan
Carpenter wrote:
> The devm_kzalloc() function returns NULL on error, not error pointers.
> Update the check to match.
>
> Fixes: ebac87cdd230 ("clk: mmp: Add Marvell PXA1908 MPMU driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
Acked-by: Duje Mihanović <duje.mihanovic@skole.hr>
Regards,
--
Duje
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe()
2024-11-20 17:18 [PATCH next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe() Dan Carpenter
2024-11-29 17:05 ` Duje Mihanović
@ 2024-12-03 20:01 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-12-03 20:01 UTC (permalink / raw)
To: Dan Carpenter, Duje Mihanović
Cc: Michael Turquette, linux-clk, linux-kernel, kernel-janitors
Quoting Dan Carpenter (2024-11-20 09:18:50)
> The devm_kzalloc() function returns NULL on error, not error pointers.
> Update the check to match.
>
> Fixes: ebac87cdd230 ("clk: mmp: Add Marvell PXA1908 MPMU driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-03 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-20 17:18 [PATCH next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe() Dan Carpenter
2024-11-29 17:05 ` Duje Mihanović
2024-12-03 20:01 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox