clk: mmp: pxa1908-apbc: Fix NULL vs IS_ERR() check in probe
Subsystems (3)
PATCH 1/1 clk: mmp: pxa1908-apbc: Fix NULL vs IS_ERR() check in probe
The devm_kzalloc() function returns NULL on error, not error pointers. Fix the check.
Fixes 51ce55919273 ("clk: mmp: Add Marvell PXA1908 APBC driver")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/clk/mmp/clk-pxa1908-apbc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mmp/clk-pxa1908-apbc.c +2 -2
@@ -96,8 +96,8 @@ static int pxa1908_apbc_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))
Signature · 1 line
2.45.2
Quoted 6 lines · On Wednesday 20 November 2024 18:18:38 Central European Standard Time Dan…
The
devm_kzalloc()function returns NULL on error, not error pointers. Fix the check.Fixes 51ce55919273 ("clk: mmp: Add Marvell PXA1908 APBC driver")Signed-off-by Dan Carpenter <[email protected]>---
Acked-by Duje Mihanović <[email protected]>
Regards,
Signature · 1 line
Duje
Quoting Dan Carpenter (2024-11-20 09:18:38)
Quoted 6 lines
The
devm_kzalloc()function returns NULL on error, not error pointers. Fix the check.Fixes 51ce55919273 ("clk: mmp: Add Marvell PXA1908 APBC driver")Signed-off-by Dan Carpenter <[email protected]>---
Applied to clk-next