Fixed a memory leak.

Submitted by:	Stanford Metacompilation research group
This commit is contained in:
Ruslan Ermilov 2004-01-18 12:26:33 +00:00
parent 7c633af872
commit b659f64e82

View file

@ -508,8 +508,10 @@ sioprobe(dev, xrid, rclk, noprobe)
return (ENXIO);
com = malloc(sizeof(*com), M_DEVBUF, M_NOWAIT | M_ZERO);
if (com == NULL)
if (com == NULL) {
bus_release_resource(dev, SYS_RES_IOPORT, rid, port);
return (ENOMEM);
}
device_set_softc(dev, com);
com->bst = rman_get_bustag(port);
com->bsh = rman_get_bushandle(port);