summaryrefslogtreecommitdiffstats
path: root/sys/pci/ncr.c
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>1999-05-21 22:02:02 +0000
committerken <ken@FreeBSD.org>1999-05-21 22:02:02 +0000
commit7f8a6535840ee0bf4f47ec29a017d9c33e23ed2c (patch)
tree30c3450912006915277e9808527e19ddcb437ae4 /sys/pci/ncr.c
parent7911c071421d0560c1f2369cf260a69ed74d5e00 (diff)
downloadFreeBSD-src-7f8a6535840ee0bf4f47ec29a017d9c33e23ed2c.zip
FreeBSD-src-7f8a6535840ee0bf4f47ec29a017d9c33e23ed2c.tar.gz
Fix a memory leak and a double free that could happen in certain error
cases. These were unlikely to happen in normal operation. Noticed by: "Christopher R. Bowman" <crb@ChrisBowman.com>
Diffstat (limited to 'sys/pci/ncr.c')
-rw-r--r--sys/pci/ncr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index 38c6731..9953bad 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncr.c,v 1.145 1999/05/09 17:07:09 peter Exp $
+** $Id: ncr.c,v 1.146 1999/05/09 22:44:42 se Exp $
**
** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family.
**
@@ -1361,7 +1361,7 @@ static void ncr_attach (pcici_t tag, int unit);
#if !defined(lint)
static const char ident[] =
- "\n$Id: ncr.c,v 1.145 1999/05/09 17:07:09 peter Exp $\n";
+ "\n$Id: ncr.c,v 1.146 1999/05/09 22:44:42 se Exp $\n";
#endif
static const u_long ncr_version = NCR_VERSION * 11
@@ -3848,7 +3848,7 @@ ncr_attach (pcici_t config_id, int unit)
if (xpt_bus_register(np->sim, 0) != CAM_SUCCESS) {
- free(np->sim, M_DEVBUF);
+ cam_sim_free(np->sim, /*free_devq*/ TRUE);
return;
}
@@ -3860,8 +3860,7 @@ ncr_attach (pcici_t config_id, int unit)
cam_sim_path(np->sim), CAM_TARGET_WILDCARD,
CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
xpt_bus_deregister(cam_sim_path(np->sim));
- cam_sim_free(np->sim, /*free_simq*/TRUE);
- free(np->sim, M_DEVBUF);
+ cam_sim_free(np->sim, /*free_devq*/TRUE);
return;
}
OpenPOWER on IntegriCloud