Return NULL on failure from nexus_alloc_resource as it reutrns a pointer.

This commit is contained in:
Andrew Turner 2015-04-27 15:16:51 +00:00
parent a364e1cf26
commit 1381f830a5

View File

@ -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);
} }
} }