[PATCH] net/enic: adjust memory check and use in proper order
John Daley (johndale)
johndale at cisco.com
Wed Jan 26 23:00:22 CET 2022
Reviewed-by: John Daley <johndale at cisco.com>
Thanks,
John
-----Original Message-----
From: Weiguo Li <liwg06 at foxmail.com>
Sent: Tuesday, January 25, 2022 4:01 AM
To: John Daley (johndale) <johndale at cisco.com>
Cc: dev at dpdk.org
Subject: [PATCH] net/enic: adjust memory check and use in proper order
Fixes: bb66d562aefc ("net/enic: share flow actions with same signature")
Signed-off-by: Weiguo Li <liwg06 at foxmail.com>
---
drivers/net/enic/enic_fm_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c index bf04d714d0..d8718d17ef 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -2521,11 +2521,11 @@ enic_action_handle_get(struct enic_flowman *fm, struct fm_action *action_in,
memcpy(fma, action_in, sizeof(*fma));
ah = calloc(1, sizeof(*ah));
- memcpy(&ah->key, action_in, sizeof(struct fm_action));
if (ah == NULL)
return rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
NULL, "enic: calloc(fm-action)");
+ memcpy(&ah->key, action_in, sizeof(struct fm_action));
args[0] = FM_ACTION_ALLOC;
args[1] = fm->cmd.pa;
ret = flowman_cmd(fm, args, 2);
--
2.25.1
More information about the dev
mailing list