in wdc_get_xfer(), avoid crashing if pool_get() fails.

This commit is contained in:
chs 2001-09-18 05:32:14 +00:00
parent e613cff3c5
commit 266b4e032c
1 changed files with 4 additions and 2 deletions

View File

@ -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, xfer = pool_get(&wdc_xfer_pool,
((flags & WDC_NOSLEEP) != 0 ? PR_NOWAIT : PR_WAITOK)); ((flags & WDC_NOSLEEP) != 0 ? PR_NOWAIT : PR_WAITOK));
splx(s); splx(s);
memset(xfer, 0, sizeof(struct wdc_xfer)); if (xfer != NULL) {
memset(xfer, 0, sizeof(struct wdc_xfer));
}
return xfer; return xfer;
} }