crypto/dpaa2_sec: fix memory allocation check
authorGagandeep Singh <g.singh@nxp.com>
Mon, 25 Jan 2021 08:15:34 +0000 (16:15 +0800)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 27 Jan 2021 19:58:14 +0000 (20:58 +0100)
commit9a494a3b90aad48f5f3f4ced14104f3347723c1b
tree5fa6883f1c6fd66d83aaddcfc613154f43344ecd
parent8dda080a0938e527c95ace0f3203a239edec48f5
crypto/dpaa2_sec: fix memory allocation check

When key length is 0, zmalloc will return NULL pointer
and in that case it should not return NOMEM.
So in this patch, adding a check on key length.

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c