diff options
author | jhb <jhb@FreeBSD.org> | 2006-09-26 15:48:13 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-09-26 15:48:13 +0000 |
commit | eaa8ea504689ef490cab68c6fd6fec925a09a5fd (patch) | |
tree | b88635f4af267be60b954224e1c970420440db77 /sys | |
parent | 7f7fe3d972a7da4fb987253da84a00339920a98a (diff) | |
download | FreeBSD-src-eaa8ea504689ef490cab68c6fd6fec925a09a5fd.zip FreeBSD-src-eaa8ea504689ef490cab68c6fd6fec925a09a5fd.tar.gz |
Fix a memory leak in ipmi_unload().
CID: 1542
Found by: Coverity Prevent
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ipmi/ipmi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index a3ba52e..fb1da53 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -949,9 +949,11 @@ ipmi_unload(void *arg) int count; int i; - devclass_get_devices(ipmi_devclass, &devs, &count); + if (devclass_get_devices(ipmi_devclass, &devs, &count) != 0) + return; for (i = 0; i < count; i++) device_delete_child(device_get_parent(devs[i]), devs[i]); + free(devs, M_TEMP); } SYSUNINIT(ipmi_unload, SI_SUB_DRIVERS, SI_ORDER_FIRST, ipmi_unload, NULL); |