common/idpf: fix possible null dereference
PATCH 1/1 common/idpf: fix possible null dereference
From: mingxial <[email protected]>
Coverity is reporting FORWARD_NULL issue when msg.ctx.indirect.payload is NULL. Adding NULL check for this.
Coverity issue: 381689
--- drivers/common/idpf/base/idpf_common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/common/idpf/base/idpf_common.c +2 -0
@@ -234,6 +234,8 @@ int idpf_clean_arq_element(struct idpf_hw *hw, e->desc.ret_val = msg.status; e->desc.datalen = msg.data_len;if (msg.data_len >0 ) { +if (!msg.ctx.indirect.payload) +return -EINVAL ; e->buf_len = msg.data_len; msg_data_len = msg.data_len; idpf_memcpy(e->msg_buf, msg.ctx.indirect.payload->va, msg_data_len,
Signature · 1 line
2.25.1
Quoted 12 lines
-----Original Message-----
From: Mingxia Liu <[email protected]>
Sent: Wednesday, November 9, 2022 1:17 PM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Wang, Xiao W <[email protected]>; Guo, Junfeng <[email protected]>; Liu, Mingxia <[email protected]>; [email protected]
Subject: [PATCH v1] common/idpf: fix possible null dereference
Quoted 8 lines
From: mingxial <[email protected]>
Coverity is reporting
FORWARD_NULLissue when msg.ctx.indirect.payload is NULL. Adding NULL check for this.Coverity issue: 381689
Fixes fb4ac04e9bfa ("common/idpf: introduce common library")
Fix current release no need Cc stable
Quoted 2 lines
Signed-off-by mingxial <[email protected]>
s/mingxial/Mingxia Liu/
Applied to dpdk-next-net-intel.
Thanks
Qi