Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01540314 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Linus Walleij
Browse files

gpio: etraxfs: Fix devm_ioremap_resource return value check



Value returned by devm_ioremap_resource() was checked for non-NULL but
devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
error this could lead to dereference of ERR_PTR.

Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Acked-by: default avatarRabin Vincent <rabin@rab.in>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 72858602
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -117,8 +117,8 @@ static int etraxfs_gpio_probe(struct platform_device *pdev)

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	regs = devm_ioremap_resource(dev, res);
	if (!regs)
		return -ENOMEM;
	if (IS_ERR(regs))
		return PTR_ERR(regs);

	match = of_match_node(etraxfs_gpio_of_table, dev->of_node);
	if (!match)