DEVICE(9): Avoid NULL pointer access

This commit is contained in:
Sebastian Huber
2017-02-14 11:48:46 +01:00
parent fd34b5202f
commit a8e84c62ae

View File

@@ -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);