summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorchs <chs@NetBSD.org>2001-09-18 05:32:14 +0000
committerchs <chs@NetBSD.org>2001-09-18 05:32:14 +0000
commit266b4e032c57ebd9e8a79e151f939d0fb61005c8 (patch)
tree34d0e0c16654da9e2e7fe6cba0b93fdbcea46aeb /sys/dev/ic
parente613cff3c51a5bb7a408685e948bba7d904c193c (diff)
in wdc_get_xfer(), avoid crashing if pool_get() fails.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/wdc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index fbb7ffad246..6018a19c58a 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc.c,v 1.98 2001/06/13 18:17:38 bjh21 Exp $ */
+/* $NetBSD: wdc.c,v 1.99 2001/09/18 05:32:14 chs Exp $ */
/*
@@ -1519,7 +1519,9 @@ 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;
}