summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2013-10-04 19:31:41 +0000
committertrasz <trasz@FreeBSD.org>2013-10-04 19:31:41 +0000
commitcf59042d5a28df352e229b74095717665e24e29c (patch)
tree7c75e695b8c1a13ac11e6a8d723c6d52ff5de5d1 /sys/dev/iscsi
parent56fd4865810492ccebaee859e1347903cae1d601 (diff)
downloadFreeBSD-src-cf59042d5a28df352e229b74095717665e24e29c.zip
FreeBSD-src-cf59042d5a28df352e229b74095717665e24e29c.tar.gz
Don't leak memory when removing an unconnected session, and remove useless
UMA_ZONE_NOFREE that caused another leak when unloading the module. Approved by: re (glebius) Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl.c5
-rw-r--r--sys/dev/iscsi/iscsi.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index eb9cf4e..6796878 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -957,6 +957,7 @@ icl_pdu_queue(struct icl_pdu *ip)
if (ic->ic_disconnecting || ic->ic_socket == NULL) {
ICL_DEBUG("icl_pdu_queue on closed connection");
ICL_CONN_UNLOCK(ic);
+ icl_pdu_free(ip);
return;
}
TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next);
@@ -1259,10 +1260,10 @@ icl_load(void)
icl_conn_zone = uma_zcreate("icl_conn",
sizeof(struct icl_conn), NULL, NULL, NULL, NULL,
- UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+ UMA_ALIGN_PTR, 0);
icl_pdu_zone = uma_zcreate("icl_pdu",
sizeof(struct icl_pdu), NULL, NULL, NULL, NULL,
- UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+ UMA_ALIGN_PTR, 0);
refcount_init(&icl_ncons, 0);
}
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index bc2fcc1..8bd2207 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -2030,7 +2030,7 @@ iscsi_load(void)
iscsi_outstanding_zone = uma_zcreate("iscsi_outstanding",
sizeof(struct iscsi_outstanding), NULL, NULL, NULL, NULL,
- UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+ UMA_ALIGN_PTR, 0);
error = make_dev_p(MAKEDEV_CHECKNAME, &sc->sc_cdev, &iscsi_cdevsw,
NULL, UID_ROOT, GID_WHEEL, 0600, "iscsi");
OpenPOWER on IntegriCloud