mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
Return NULL on failure from nexus_alloc_resource as it reutrns a pointer.
This commit is contained in:
parent
a364e1cf26
commit
1381f830a5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282096
@ -208,12 +208,12 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return (0);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = rman_reserve_resource(rm, start, end, count, flags, child);
|
rv = rman_reserve_resource(rm, start, end, count, flags, child);
|
||||||
if (rv == 0)
|
if (rv == 0)
|
||||||
return (0);
|
return (NULL);
|
||||||
|
|
||||||
rman_set_rid(rv, *rid);
|
rman_set_rid(rv, *rid);
|
||||||
rman_set_bushandle(rv, rman_get_start(rv));
|
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 (needactivate) {
|
||||||
if (bus_activate_resource(child, type, *rid, rv)) {
|
if (bus_activate_resource(child, type, *rid, rv)) {
|
||||||
rman_release_resource(rv);
|
rman_release_resource(rv);
|
||||||
return (0);
|
return (NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user