[PATCH] pinctrl: at91: Bail out if atmel, pins property does not exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not blindly assume that a device node has a atmel,pins property.
Instead, test it for being NULL before using it. This also silences
a compiler warning when the driver is compiled without OF support.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/pinctrl/pinctrl-at91.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 021c1e5a2e..d52c184e44 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -449,6 +449,9 @@ static int at91_pinctrl_set_state(struct pinctrl_device *pdev, struct device_nod
 	info = to_at91_pinctrl(pdev);
 
 	list = of_get_property(np, "atmel,pins", &size);
+	if (!list)
+		return -EINVAL;
+
 	size /= sizeof(*list);
 
 	if (!size || size % 4) {
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux