[rtems-libbsd commit] DEVICE(9): Avoid NULL pointer access
Sebastian Huber
sebh at rtems.org
Mon Oct 23 07:27:50 UTC 2017
Module: rtems-libbsd
Branch: master
Commit: a8e84c62aea17714ce95f49065243af1965f7f07
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=a8e84c62aea17714ce95f49065243af1965f7f07
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Feb 14 11:48:46 2017 +0100
DEVICE(9): Avoid NULL pointer access
---
freebsd/sys/kern/subr_bus.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/freebsd/sys/kern/subr_bus.c b/freebsd/sys/kern/subr_bus.c
index e554366..fdc47ab 100644
--- a/freebsd/sys/kern/subr_bus.c
+++ b/freebsd/sys/kern/subr_bus.c
@@ -272,6 +272,9 @@ device_sysctl_handler(SYSCTL_HANDLER_ARGS)
break;
case DEVICE_SYSCTL_PARENT:
value = dev->parent ? dev->parent->nameunit : "";
+#ifdef __rtems__
+ value = value ? value : "";
+#endif /* __rtems__ */
break;
default:
return (EINVAL);
More information about the vc
mailing list