diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2010-07-02 02:40:18 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2010-07-02 02:40:18 +0000 |
commit | bfc9493d9280a5a8ab43b8df30cd772c910140ba (patch) | |
tree | 32334a91bf10c89a8551f90fe6749d45476d9ad8 /sys/dev/pci/safe.c | |
parent | 364840df3893a5f720df05ee307b996c62195a07 (diff) |
m_copyback can fail to allocate memory, but is a void fucntion so gymnastics
are required to detect that.
Change the function to take a wait argument (used in nfs server, but
M_NOWAIT everywhere else for now) and to return an error
ok claudio@ henning@ krw@
Diffstat (limited to 'sys/dev/pci/safe.c')
-rw-r--r-- | sys/dev/pci/safe.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c index 189d24ccd1b..98111ccf67a 100644 --- a/sys/dev/pci/safe.c +++ b/sys/dev/pci/safe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe.c,v 1.28 2010/04/06 22:28:07 tedu Exp $ */ +/* $OpenBSD: safe.c,v 1.29 2010/07/02 02:40:16 blambert Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -476,7 +476,8 @@ safe_process(struct cryptop *crp) if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) { if (crp->crp_flags & CRYPTO_F_IMBUF) m_copyback(re->re_src_m, - enccrd->crd_inject, ivsize, iv); + enccrd->crd_inject, ivsize, iv, + M_NOWAIT); else if (crp->crp_flags & CRYPTO_F_IOV) cuio_copyback(re->re_src_io, enccrd->crd_inject, ivsize, iv); @@ -1719,7 +1720,8 @@ safe_callback(struct safe_softc *sc, struct safe_ringentry *re) if (crp->crp_flags & CRYPTO_F_IMBUF) { m_copyback((struct mbuf *)crp->crp_buf, crd->crd_inject, 12, - (caddr_t)re->re_sastate.sa_saved_indigest); + (caddr_t)re->re_sastate.sa_saved_indigest, + M_NOWAIT); } else if (crp->crp_flags & CRYPTO_F_IOV && crp->crp_mac) { bcopy((caddr_t)re->re_sastate.sa_saved_indigest, crp->crp_mac, 12); |