Skip to content

Commit e5ca5d7

Browse files
Dan Carpenterbebarino
authored andcommitted
clk: mmp: pxa1908-apbc: Fix NULL vs IS_ERR() check
The devm_kzalloc() function returns NULL on error, not error pointers. Fix the check. Fixes: 51ce559 ("clk: mmp: Add Marvell PXA1908 APBC driver") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Duje Mihanović <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 3acea81 commit e5ca5d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/mmp/clk-pxa1908-apbc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ static int pxa1908_apbc_probe(struct platform_device *pdev)
9696
struct pxa1908_clk_unit *pxa_unit;
9797

9898
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
99-
if (IS_ERR(pxa_unit))
100-
return PTR_ERR(pxa_unit);
99+
if (!pxa_unit)
100+
return -ENOMEM;
101101

102102
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
103103
if (IS_ERR(pxa_unit->base))

0 commit comments

Comments
 (0)