From b44f808797e582a025aa71108f245704610c4fdf Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 1 Jun 2003 09:24:17 +0000 Subject: [PATCH] Don't leak "barlist" allocation on failure. Found by: FlexeLint --- sys/dev/cardbus/cardbus_cis.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c index 2878f13cfaf2..f036ffa85d97 100644 --- a/sys/dev/cardbus/cardbus_cis.c +++ b/sys/dev/cardbus/cardbus_cis.c @@ -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);