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 <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/5b3b963d-ecae-4819-be47-d82e8a58e64b@stanley.mountain Acked-by: Duje Mihanović <duje.mihanovic@skole.hr> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 40384c8 commit 7def56f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)