net/nfp: fix one memory access problem
Checks
Commit Message
The initial logic do not give a value to the out parameter in the
abnormal logic, which cause an local variable uninitialized problem.
Fixes: 3d6811281392 ("net/nfp: add infrastructure for conntrack flow merge")
Cc: chaoyong.he@corigine.com
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/flower/nfp_conntrack.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 10/8/2023 8:08 AM, Chaoyong He wrote:
> The initial logic do not give a value to the out parameter in the
> abnormal logic, which cause an local variable uninitialized problem.
>
> Fixes: 3d6811281392 ("net/nfp: add infrastructure for conntrack flow merge")
> Cc: chaoyong.he@corigine.com
>
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
Applied to dpdk-next-net/main, thanks.
@@ -332,6 +332,7 @@ nfp_flow_item_conf_size_get(enum rte_flow_item_type type,
break;
default:
PMD_DRV_LOG(ERR, "Unsupported item type: %d", type);
+ *size = 0;
return false;
}
@@ -1265,9 +1266,9 @@ nfp_ct_merge_item_real(const struct rte_flow_item *item_src,
struct rte_flow_item *item_dst)
{
uint32_t i;
- size_t size;
char *key_dst;
char *mask_dst;
+ size_t size = 0;
const char *key_src;
const char *mask_src;