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 <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/d7078eb7-a7d6-4753-b453-8fce15245c34@stanley.mountain Acked-by: Duje Mihanović <duje.mihanovic@skole.hr> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 3acea81 commit e5ca5d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)