summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Frank <Justin.Frank@Sun.COM>2010-06-16 20:01:06 -0700
committerJustin Frank <Justin.Frank@Sun.COM>2010-06-16 20:01:06 -0700
commit8d61a337e3509e92fccb0fdeb26db712c21d43cd (patch)
treea1ad9c1fa639c0d167c4c285f40f31e7a7ed8b56
parent3e4e8481018f11b2565c3f702e25bb486da178db (diff)
downloadillumos-joyent-8d61a337e3509e92fccb0fdeb26db712c21d43cd.tar.gz
6800232 memory leaks in ibdm_update_port_attr
-rw-r--r--usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c b/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c
index 94477852ac..86d6113c64 100644
--- a/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c
+++ b/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -1052,6 +1051,8 @@ ibdm_handle_hca_detach(ib_guid_t hca_guid)
ibdm_hca_list_t *head, *prev = NULL;
size_t len;
ibdm_dp_gidinfo_t *gidinfo;
+ ibdm_port_attr_t *port_attr;
+ int i;
IBTF_DPRINTF_L4("ibdm",
"\thandle_hca_detach: hca_guid = 0x%llx", hca_guid);
@@ -1097,7 +1098,14 @@ ibdm_handle_hca_detach(ib_guid_t hca_guid)
head->hl_next;
else
prev->hl_next = head->hl_next;
-
+ for (i = 0; i < head->hl_nports; i++) {
+ port_attr = &head->hl_port_attr[i];
+ if (port_attr->pa_pkey_tbl != NULL)
+ kmem_free(
+ port_attr->pa_pkey_tbl,
+ port_attr->pa_npkeys *
+ sizeof (ibdm_pkey_tbl_t));
+ }
len = sizeof (ibdm_hca_list_t) +
(head->hl_nports *
sizeof (ibdm_port_attr_t));