gpio: x-gene: fix devm_ioremap_resource() check
devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never returns NULL, fix the check to prevent access to invalid virtual address. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Родитель
cbfb3ea7f8
Коммит
33c07b4677
|
@ -93,7 +93,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
|
|||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (!regs)
|
||||
if (IS_ERR(regs))
|
||||
return PTR_ERR(regs);
|
||||
|
||||
ret = bgpio_init(&priv->bgc, &pdev->dev, 4,
|
||||
|
|
Загрузка…
Ссылка в новой задаче