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

Commit 5664de25 authored by LABBE Corentin's avatar LABBE Corentin Committed by Linus Walleij
Browse files

gpio: palmas: fix a possible NULL dereference



of_match_device could return NULL, and so cause a NULL pointer
dereference later.

Reported-by: coverity (CID 1130700)
Signed-off-by: default avatarLABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 853f0cb8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -167,6 +167,8 @@ static int palmas_gpio_probe(struct platform_device *pdev)
	const struct palmas_device_data *dev_data;

	match = of_match_device(of_palmas_gpio_match, &pdev->dev);
	if (!match)
		return -ENODEV;
	dev_data = match->data;
	if (!dev_data)
		dev_data = &palmas_dev_data;