summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-01-01 16:16:23 +0000
committerbluhm <bluhm@openbsd.org>2018-01-01 16:16:23 +0000
commit71db4ff6bbee6140c600730e6451b94e3e9f7d7b (patch)
tree2c81efea2d15e5deff1d25fe869a1d5608a368e3
parentTweak syntax comments into consistency and completeness. (diff)
downloadwireguard-openbsd-71db4ff6bbee6140c600730e6451b94e3e9f7d7b.tar.xz
wireguard-openbsd-71db4ff6bbee6140c600730e6451b94e3e9f7d7b.zip
The missing NULL check for the return value of malloc(9) with
M_NOWAIT is wrong. Use M_WAITOK in ipmi_match() during attach. OK kettenis@
-rw-r--r--sys/dev/ipmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 788838a1d60..4e3be12e6e2 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.99 2017/09/08 05:36:52 deraadt Exp $ */
+/* $OpenBSD: ipmi.c,v 1.100 2018/01/01 16:16:23 bluhm Exp $ */
/*
* Copyright (c) 2015 Masao Uebayashi
@@ -1652,7 +1652,7 @@ ipmi_match(struct device *parent, void *match, void *aux)
return (0);
/* XXX local softc is wrong wrong wrong */
- sc = malloc(sizeof(*sc), M_TEMP, M_NOWAIT | M_ZERO);
+ sc = malloc(sizeof(*sc), M_TEMP, M_WAITOK | M_ZERO);
mtx_init(&sc->sc_cmd_mtx, IPL_NONE);
strlcpy(sc->sc_dev.dv_xname, "ipmi0", sizeof(sc->sc_dev.dv_xname));