mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Don't leak "barlist" allocation on failure.
Found by: FlexeLint
This commit is contained in:
parent
4df05d61bd
commit
b44f808797
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115613
@ -854,6 +854,7 @@ cardbus_alloc_resources(device_t cbdev, device_t child)
|
||||
if (res == NULL) {
|
||||
device_printf(cbdev,
|
||||
"Can't get memory for prefetch mem\n");
|
||||
free(barlist, M_DEVBUF);
|
||||
return (EIO);
|
||||
}
|
||||
start = rman_get_start(res);
|
||||
@ -900,6 +901,7 @@ cardbus_alloc_resources(device_t cbdev, device_t child)
|
||||
if (res == NULL) {
|
||||
device_printf(cbdev,
|
||||
"Can't get memory for non-prefetch mem\n");
|
||||
free(barlist, M_DEVBUF);
|
||||
return (EIO);
|
||||
}
|
||||
start = rman_get_start(res);
|
||||
@ -945,6 +947,7 @@ cardbus_alloc_resources(device_t cbdev, device_t child)
|
||||
if (res == NULL) {
|
||||
device_printf(cbdev,
|
||||
"Can't get memory for IO ports\n");
|
||||
free(barlist, M_DEVBUF);
|
||||
return (EIO);
|
||||
}
|
||||
start = rman_get_start(res);
|
||||
@ -970,6 +973,7 @@ cardbus_alloc_resources(device_t cbdev, device_t child)
|
||||
RF_SHAREABLE);
|
||||
if (res == NULL) {
|
||||
device_printf(cbdev, "Can't get memory for irq\n");
|
||||
free(barlist, M_DEVBUF);
|
||||
return (EIO);
|
||||
}
|
||||
start = rman_get_start(res);
|
||||
|
Loading…
Reference in New Issue
Block a user