summaryrefslogtreecommitdiff
path: root/usr/src/common/mdesc
diff options
context:
space:
mode:
authorla135387 <none@none>2005-07-22 16:18:39 -0700
committerla135387 <none@none>2005-07-22 16:18:39 -0700
commit26cf27f05670b1ca90e4a07802cba858cb358690 (patch)
treee688cf237930db054ae49f8feea76058db33ad64 /usr/src/common/mdesc
parent70f54ead78cbbb40e97bd3ff9f175c5c71783c3c (diff)
downloadillumos-joyent-26cf27f05670b1ca90e4a07802cba858cb358690.tar.gz
6263078 Machine description API doesn't support kmem_free()
6264415 md_fini should not free the pointer to the machine description data 6292409 prtdiag: cannot open /dev/openprom: Permission denied ; when run as non root user only
Diffstat (limited to 'usr/src/common/mdesc')
-rw-r--r--usr/src/common/mdesc/mdesc_fini.c3
-rw-r--r--usr/src/common/mdesc/mdesc_init_intern.c5
-rw-r--r--usr/src/common/mdesc/mdesc_scandag.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/usr/src/common/mdesc/mdesc_fini.c b/usr/src/common/mdesc/mdesc_fini.c
index f449150be5..f0b010b386 100644
--- a/usr/src/common/mdesc/mdesc_fini.c
+++ b/usr/src/common/mdesc/mdesc_fini.c
@@ -37,8 +37,7 @@ md_fini(md_t *ptr)
mdp = (md_impl_t *)ptr;
- mdp->freep(mdp->caddr);
- mdp->freep(mdp);
+ mdp->freep(mdp, sizeof (md_impl_t));
return (0);
}
diff --git a/usr/src/common/mdesc/mdesc_init_intern.c b/usr/src/common/mdesc/mdesc_init_intern.c
index 8148a133dd..2ba2877abb 100644
--- a/usr/src/common/mdesc/mdesc_init_intern.c
+++ b/usr/src/common/mdesc/mdesc_init_intern.c
@@ -32,7 +32,8 @@
#include <sys/mdesc_impl.h>
md_t *
-md_init_intern(uint64_t *ptr, void *(*allocp)(size_t), void (*freep)(void *))
+md_init_intern(uint64_t *ptr, void *(*allocp)(size_t),
+ void (*freep)(void *, size_t))
{
md_impl_t *mdp;
int idx;
@@ -160,6 +161,6 @@ cleanup:;
* we build one.
*/
cleanup_nohash:;
- mdp->freep(mdp);
+ mdp->freep(mdp, sizeof (md_impl_t));
return (NULL);
}
diff --git a/usr/src/common/mdesc/mdesc_scandag.c b/usr/src/common/mdesc/mdesc_scandag.c
index 58e0b0d39f..11b4e24ab2 100644
--- a/usr/src/common/mdesc/mdesc_scandag.c
+++ b/usr/src/common/mdesc/mdesc_scandag.c
@@ -112,7 +112,7 @@ md_scan_dag(md_t *ptr,
node_name_cookie, arc_name_cookie,
seenp, &idx, stashp, 0);
- mdp->freep(seenp);
+ mdp->freep(seenp, mdp->element_count);
return (res >= 0 ? idx : res);
}