crypto/qat: fix allocation check and leak
authorYong Wang <wang.yong19@zte.com.cn>
Thu, 25 Jan 2018 06:53:04 +0000 (01:53 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 31 Jan 2018 23:34:51 +0000 (00:34 +0100)
commit963898f0e316611df9dc2964d059b4e16835b95a
tree86921d0f788ecdd524d3b4d1ef232a37bec5505a
parent22e8c9f341adc255d73efba6bea0b9fed5351220
crypto/qat: fix allocation check and leak

There are several func calls to rte_zmalloc() which don't do null
point check on the return value. And before return, the memory is not
freed. Fix it by adding null point check and rte_free().

Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")
Fixes: e09231eaa2af ("crypto/qat: add SGL capability")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/crypto/qat/qat_adf/qat_algs_build_desc.c
drivers/crypto/qat/qat_qp.c