summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2001-04-02 19:01:18 +0000
committerart <art@openbsd.org>2001-04-02 19:01:18 +0000
commitc3a9b8c34a8cc360574bf058219cc57fc5a099c7 (patch)
treef3ec76a82baf705c51f043a6fa0c075ccc1c0853
parentgrammar; slade@shore.net (diff)
downloadwireguard-openbsd-c3a9b8c34a8cc360574bf058219cc57fc5a099c7.tar.xz
wireguard-openbsd-c3a9b8c34a8cc360574bf058219cc57fc5a099c7.zip
pool_get with PR_NOWAIT can fail. Handle that.
(the old code could return NULL and the callers check for that, so it should be ok.
-rw-r--r--sys/dev/ic/wdc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index 555edbd9912..56e6047ee07 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.28 2001/03/25 13:11:51 csapuntz Exp $ */
+/* $OpenBSD: wdc.c,v 1.29 2001/04/02 19:01:18 art Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -1759,7 +1759,8 @@ wdc_get_xfer(flags)
xfer = pool_get(&wdc_xfer_pool,
((flags & WDC_NOSLEEP) != 0 ? PR_NOWAIT : PR_WAITOK));
splx(s);
- memset(xfer, 0, sizeof(struct wdc_xfer));
+ if (xfer != NULL)
+ memset(xfer, 0, sizeof(struct wdc_xfer));
return xfer;
}