Skip to content

Commit 7def56f

Browse files
Dan Carpenterbebarino
authored andcommitted
clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check
The devm_kzalloc() function returns NULL on error, not error pointers. Update the check to match. Fixes: ebac87c ("clk: mmp: Add Marvell PXA1908 MPMU 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 40384c8 commit 7def56f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ static int pxa1908_mpmu_probe(struct platform_device *pdev)
7878
struct pxa1908_clk_unit *pxa_unit;
7979

8080
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
81-
if (IS_ERR(pxa_unit))
82-
return PTR_ERR(pxa_unit);
81+
if (!pxa_unit)
82+
return -ENOMEM;
8383

8484
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
8585
if (IS_ERR(pxa_unit->base))

0 commit comments

Comments
 (0)