nexus: Consistently return a pointer in failure paths

No functional change intended.

MFC after:	1 week
This commit is contained in:
Mark Johnston
2023-04-26 17:19:28 -04:00
parent 44866dfb44
commit ca4c785900
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -256,7 +256,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);
}
}
+2 -2
View File
@@ -388,13 +388,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
rv = rman_reserve_resource(rm, start, end, count, flags, child);
if (rv == NULL)
return (0);
return (NULL);
rman_set_rid(rv, *rid);
if (needactivate) {
if (bus_activate_resource(child, type, *rid, rv)) {
rman_release_resource(rv);
return (0);
return (NULL);
}
}