mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 05:11:15 +08:00
DEVICE(9): Avoid NULL pointer access
This commit is contained in:
@@ -272,6 +272,9 @@ device_sysctl_handler(SYSCTL_HANDLER_ARGS)
|
|||||||
break;
|
break;
|
||||||
case DEVICE_SYSCTL_PARENT:
|
case DEVICE_SYSCTL_PARENT:
|
||||||
value = dev->parent ? dev->parent->nameunit : "";
|
value = dev->parent ? dev->parent->nameunit : "";
|
||||||
|
#ifdef __rtems__
|
||||||
|
value = value ? value : "";
|
||||||
|
#endif /* __rtems__ */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
Reference in New Issue
Block a user