diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-09-26 19:37:29 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-09-26 19:37:29 +0000 |
commit | 46eb24c92daaf04a3c5c86df47d9aef5d260c41b (patch) | |
tree | c2cc421efec720b0fe2c77b43e988a288875403b /sys/dev/pci | |
parent | faa03df06ef0474a03d7a7e6aec6857dcee67afe (diff) |
Set sk_jumbo_buf to NULL if malloc() fails in the for loop within
[m]sk_alloc_jumbo_mem().
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_msk.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/if_sk.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 58a74f9a104..66e3316c86b 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.19 2006/09/25 23:26:36 brad Exp $ */ +/* $OpenBSD: if_msk.c,v 1.20 2006/09/26 19:37:28 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -598,6 +598,7 @@ msk_alloc_jumbo_mem(struct sk_if_softc *sc_if) entry = malloc(sizeof(struct sk_jpool_entry), M_DEVBUF, M_NOWAIT); if (entry == NULL) { + sc_if->sk_cdata.sk_jumbo_buf = NULL; printf(": no memory for jumbo buffer queue!"); error = ENOBUFS; goto out; diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index e0e61a57ea7..482fb39c69c 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.126 2006/09/18 04:05:05 brad Exp $ */ +/* $OpenBSD: if_sk.c,v 1.127 2006/09/26 19:37:28 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -766,6 +766,7 @@ sk_alloc_jumbo_mem(struct sk_if_softc *sc_if) entry = malloc(sizeof(struct sk_jpool_entry), M_DEVBUF, M_NOWAIT); if (entry == NULL) { + sc_if->sk_cdata.sk_jumbo_buf = NULL; printf(": no memory for jumbo buffer queue!"); error = ENOBUFS; goto out; |