diff options
Diffstat (limited to 'sys/dev/hifn/hifn7751.c')
-rw-r--r-- | sys/dev/hifn/hifn7751.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index ea87bd6..accb531 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -1668,6 +1668,10 @@ hifn_crypto( if (cmd->src_m->m_flags & M_PKTHDR) { len = MHLEN; MGETHDR(m0, M_DONTWAIT, MT_DATA); + if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_DONTWAIT)) { + m_free(m0); + m0 = NULL; + } } else { len = MLEN; MGET(m0, M_DONTWAIT, MT_DATA); @@ -1677,9 +1681,6 @@ hifn_crypto( err = dma->cmdu ? ERESTART : ENOMEM; goto err_srcmap; } - if (len == MHLEN) { - M_COPY_PKTHDR(m0, cmd->src_m); - } if (totlen >= MINCLSIZE) { MCLGET(m0, M_DONTWAIT); if ((m0->m_flags & M_EXT) == 0) { |