Skip to content

Commit 00153c6

Browse files
Charles Hanbebarino
authored andcommitted
clk: mmp: Fix NULL vs IS_ERR() check
The devm_kzalloc() function returns NULL on error, not error pointers. Fix the check. Fixes: 03437e8 ("clk: mmp: Add Marvell PXA1908 APMU driver") Signed-off-by: Charles Han <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 12a0fd2 commit 00153c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
8787
struct pxa1908_clk_unit *pxa_unit;
8888

8989
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
90-
if (IS_ERR(pxa_unit))
91-
return PTR_ERR(pxa_unit);
90+
if (!pxa_unit)
91+
return -ENOMEM;
9292

9393
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
9494
if (IS_ERR(pxa_unit->base))

0 commit comments

Comments
 (0)