Defects reported by coverity scan
uninit_use_in_call: Using uninitialized element of array clen when
calling cpu_crypto_bulk.
Coverity issue: 354233, 354234
Fixes:
957394f72658 ("ipsec: support CPU crypto mode")
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
move_bad_mbufs(mb, dr, num, num - k);
/* convert mbufs to iovecs and do actual crypto/auth processing */
- cpu_crypto_bulk(ss, sa->cofs, mb, iv, aad, dgst, l4ofs, clen, k);
+ if (k != 0)
+ cpu_crypto_bulk(ss, sa->cofs, mb, iv, aad, dgst,
+ l4ofs, clen, k);
return k;
}
move_bad_mbufs(mb, dr, n, n - k);
/* convert mbufs to iovecs and do actual crypto/auth processing */
- cpu_crypto_bulk(ss, sa->cofs, mb, iv, aad, dgst, l4ofs, clen, k);
+ if (k != 0)
+ cpu_crypto_bulk(ss, sa->cofs, mb, iv, aad, dgst,
+ l4ofs, clen, k);
return k;
}
}
/*
- * process packets using sync crypto engine
+ * process packets using sync crypto engine.
+ * expects *num* to be greater than zero.
*/
static inline void
cpu_crypto_bulk(const struct rte_ipsec_session *ss,