mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
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: 51ce559192
("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>
This commit is contained in:
parent
3acea81be6
commit
e5ca5d7b4d
@ -96,8 +96,8 @@ static int pxa1908_apbc_probe(struct platform_device *pdev)
|
||||
struct pxa1908_clk_unit *pxa_unit;
|
||||
|
||||
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
|
||||
if (IS_ERR(pxa_unit))
|
||||
return PTR_ERR(pxa_unit);
|
||||
if (!pxa_unit)
|
||||
return -ENOMEM;
|
||||
|
||||
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(pxa_unit->base))
|
||||
|
Loading…
Reference in New Issue
Block a user