nexus: Consistently return a pointer in failure paths
No functional change intended. MFC after: 1 week
This commit is contained in:
+1
-1
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user