diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2011-04-05 11:48:29 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2011-04-05 11:48:29 +0000 |
commit | 94443e3a8469c3b4270194ffd9a06c03702ce903 (patch) | |
tree | a3ac085f92f3f31be825d2ee4b46a3cc2dda8a61 /sys/dev/pci/ubsec.c | |
parent | a5b5f8337f372b5773fb995fbbf744d56eb5e396 (diff) |
Passing M_WAITOK to mbuf functions is supposed to be a contract between
the caller and the function that the function will not fail to allocate
memory and return a NULL pointer. However, m_dup_pkthdr() violates
this contract, making it possible for functions that pass M_WAITOK to
be surprised in ways that hurt.
Fix this by passing the wait flag all the way down the functions that
actually do the allocation for m_dup_pkthdr() so that we won't be
surprised.
man page update forthcoming
ok claudio@
Diffstat (limited to 'sys/dev/pci/ubsec.c')
-rw-r--r-- | sys/dev/pci/ubsec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index a1958fa2b77..9e2402e1185 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsec.c,v 1.151 2011/04/03 15:36:03 jasper Exp $ */ +/* $OpenBSD: ubsec.c,v 1.152 2011/04/05 11:48:28 blambert Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -1153,7 +1153,8 @@ ubsec_process(struct cryptop *crp) goto errout; } if (len == MHLEN) { - err = m_dup_pkthdr(m, q->q_src_m); + err = m_dup_pkthdr(m, q->q_src_m, + M_DONTWAIT); if (err) { m_freem(m); goto errout; |