Return NULL on failure from nexus_alloc_resource as it reutrns a pointer.
This commit is contained in:
parent
a364e1cf26
commit
1381f830a5
@ -208,12 +208,12 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
break;
|
||||
|
||||
default:
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
rv = rman_reserve_resource(rm, start, end, count, flags, child);
|
||||
if (rv == 0)
|
||||
return (0);
|
||||
return (NULL);
|
||||
|
||||
rman_set_rid(rv, *rid);
|
||||
rman_set_bushandle(rv, rman_get_start(rv));
|
||||
@ -221,7 +221,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
if (needactivate) {
|
||||
if (bus_activate_resource(child, type, *rid, rv)) {
|
||||
rman_release_resource(rv);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user