Not all i.MX6 devices have a pinctrl property in their device nodes.
authorpatrick <patrick@openbsd.org>
Sun, 10 Jul 2016 20:53:04 +0000 (20:53 +0000)
committerpatrick <patrick@openbsd.org>
Sun, 10 Jul 2016 20:53:04 +0000 (20:53 +0000)
In that case, soft fail and return instead of allocating buffer with
a bogus size.

ok kettenis@

sys/arch/armv7/imx/imxiomuxc.c

index 5a930db..ae41029 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxiomuxc.c,v 1.4 2016/07/10 17:17:22 kettenis Exp $ */
+/* $OpenBSD: imxiomuxc.c,v 1.5 2016/07/10 20:53:04 patrick Exp $ */
 /*
  * Copyright (c) 2013 Patrick Wildt <patrick@blueri.se>
  * Copyright (c) 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -172,7 +172,7 @@ imxiomuxc_pinctrlbyname(int node, const char *config)
 
        len = OF_getproplen(node, "pinctrl-names");
        if (len <= 0)
-               printf("no pinctrl-names\n");
+               return -1;
 
        names = malloc(len, M_TEMP, M_WAITOK);
        OF_getprop(node, "pinctrl-names", names, len);