Skip to content

Commit 3acea81

Browse files
Dan Carpenterbebarino
authored andcommitted
clk: mmp: pxa1908-apbcp: Fix a NULL vs IS_ERR() check
The devm_kzalloc() function doesn't return error pointers, it returns NULL on error. Update the check to match. Fixes: a89233d ("clk: mmp: Add Marvell PXA1908 APBCP 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 7def56f commit 3acea81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ static int pxa1908_apbcp_probe(struct platform_device *pdev)
4848
struct pxa1908_clk_unit *pxa_unit;
4949

5050
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
51-
if (IS_ERR(pxa_unit))
52-
return PTR_ERR(pxa_unit);
51+
if (!pxa_unit)
52+
return -ENOMEM;
5353

5454
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
5555
if (IS_ERR(pxa_unit->base))

0 commit comments

Comments
 (0)