mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-13 20:49:17 +08:00
nexus: Avoid NULL pointer access
This commit is contained in:
parent
329cf5c013
commit
bd6b20c0e6
@ -174,7 +174,10 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
}
|
||||
|
||||
SET_FOREACH(nd, nexus) {
|
||||
if (strcmp(device_get_name(child), nd->name) == 0
|
||||
const char *name;
|
||||
|
||||
name = device_get_name(child);
|
||||
if (name != NULL && strcmp(name, nd->name) == 0
|
||||
&& device_get_unit(child) == nd->unit) {
|
||||
if (nexus_get_start(nd, type, &start)) {
|
||||
res = rman_reserve_resource(rm, start, end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user