artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1be4be9
)
Avoid null-pointer dereference wen a device tree refers to a pin-function
author
kettenis
<kettenis@openbsd.org>
Sat, 23 Dec 2017 12:28:45 +0000
(12:28 +0000)
committer
kettenis
<kettenis@openbsd.org>
Sat, 23 Dec 2017 12:28:45 +0000
(12:28 +0000)
that doesn't exist.
sys/dev/fdt/sxipio.c
patch
|
blob
|
history
diff --git
a/sys/dev/fdt/sxipio.c
b/sys/dev/fdt/sxipio.c
index
7e113ed
..
2298baf
100644
(file)
--- a/
sys/dev/fdt/sxipio.c
+++ b/
sys/dev/fdt/sxipio.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: sxipio.c,v 1.
5 2017/11/13 09:24:59
kettenis Exp $ */
+/* $OpenBSD: sxipio.c,v 1.
6 2017/12/23 12:28:45
kettenis Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
* Copyright (c) 2013 Artturi Alm
@@
-292,6
+292,8
@@
sxipio_pinctrl(uint32_t phandle, void *cookie)
/* Lookup the function of the pin. */
for (j = 0; j < nitems(sc->sc_pins[i].funcs); j++) {
+ if (sc->sc_pins[i].funcs[j].name == NULL)
+ continue;
if (strcmp(func, sc->sc_pins[i].funcs[j].name) == 0)
break;
}