diff mbox series

[next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe()

Message ID 5b3b963d-ecae-4819-be47-d82e8a58e64b@stanley.mountain (mailing list archive)
State Accepted, archived
Headers show
Series [next] clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check in probe() | expand

Commit Message

Dan Carpenter Nov. 20, 2024, 5:18 p.m. UTC
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(-)

Comments

Duje Mihanović Nov. 29, 2024, 5:05 p.m. UTC | #1
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,
Stephen Boyd Dec. 3, 2024, 8:01 p.m. UTC | #2
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
diff mbox series

Patch

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))