summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2011-04-18 20:07:08 +0000
committerglebius <glebius@FreeBSD.org>2011-04-18 20:07:08 +0000
commit53a0fd8ac354d0c7779815e2ef3aeeaec9ceee0f (patch)
treef4352a5958a7b8f9b17e2c8cf3b91ba8f8a3cda9 /sys/netinet/libalias
parent3ba2f4e3f25cf378d2dc011328cd7950c6af5b2f (diff)
downloadFreeBSD-src-53a0fd8ac354d0c7779815e2ef3aeeaec9ceee0f.zip
FreeBSD-src-53a0fd8ac354d0c7779815e2ef3aeeaec9ceee0f.tar.gz
LibAliasInit() should allocate memory with M_WAITOK flag. Modify it
and its callers.
Diffstat (limited to 'sys/netinet/libalias')
-rw-r--r--sys/netinet/libalias/alias_db.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
index 09b8513..9b30793 100644
--- a/sys/netinet/libalias/alias_db.c
+++ b/sys/netinet/libalias/alias_db.c
@@ -2490,9 +2490,14 @@ LibAliasInit(struct libalias *la)
#endif
if (la == NULL) {
+#ifdef _KERNEL
+#undef malloc /* XXX: ugly */
+ la = malloc(sizeof *la, M_ALIAS, M_WAITOK | M_ZERO);
+#else
la = calloc(sizeof *la, 1);
if (la == NULL)
return (la);
+#endif
#ifndef _KERNEL /* kernel cleans up on module unload */
if (LIST_EMPTY(&instancehead))
OpenPOWER on IntegriCloud