diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2002-08-08 13:29:32 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2002-08-08 13:29:32 +0000 |
commit | d6a59aa6165e0dbc0e5c55a357263ea086d96452 (patch) | |
tree | 22aee5f8b62d80b282ac1ca7504bc79ffd2e0662 | |
parent | 551b01816473e54a6e1f016eb785582cccb85212 (diff) | |
download | FreeBSD-src-d6a59aa6165e0dbc0e5c55a357263ea086d96452.zip FreeBSD-src-d6a59aa6165e0dbc0e5c55a357263ea086d96452.tar.gz |
YIKES, I take the pointy-hat for a really big braino here. I
appologize to those of you who may have been seeing crashes in
code that uses sendfile(2) or other types of external buffers
with mbufs.
Pointed out by, and provided trace:
Niels Chr. Bank-Pedersen <ncbp at bank-pedersen.dk>
-rw-r--r-- | sys/kern/subr_mbuf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c index 00c5c5f..1fa38f8 100644 --- a/sys/kern/subr_mbuf.c +++ b/sys/kern/subr_mbuf.c @@ -1050,10 +1050,9 @@ mb_reclaim(void) } while (0) #define _mext_init_ref(m, ref) do { \ - if ((ref) == NULL) \ - malloc(sizeof(u_int), M_MBUF, M_NOWAIT); \ - else \ - (m)->m_ext.ref_cnt = (u_int *)(ref); \ + (m)->m_ext.ref_cnt = ((ref) == NULL) ? \ + malloc(sizeof(u_int), M_MBUF, M_NOWAIT) : \ + (m)->m_ext.ref_cnt = (u_int *)(ref); \ if ((m)->m_ext.ref_cnt != NULL) { \ *((m)->m_ext.ref_cnt) = 0; \ MEXT_ADD_REF((m)); \ |