DPDK patches and discussions
 help / color / mirror / Atom feed
From: "John Daley (johndale)" <johndale@cisco.com>
To: Weiguo Li <liwg06@foxmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] net/enic: adjust memory check and use in proper order
Date: Wed, 26 Jan 2022 22:00:22 +0000	[thread overview]
Message-ID: <BYAPR11MB25358889F72E9873E1B80EF5CF209@BYAPR11MB2535.namprd11.prod.outlook.com> (raw)
In-Reply-To: <tencent_1C910791FD18399E80538A08419DAB6FBE07@qq.com>

Reviewed-by: John Daley <johndale@cisco.com>

Thanks,
John

-----Original Message-----
From: Weiguo Li <liwg06@foxmail.com> 
Sent: Tuesday, January 25, 2022 4:01 AM
To: John Daley (johndale) <johndale@cisco.com>
Cc: dev@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@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


  reply	other threads:[~2022-01-26 22:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 12:00 Weiguo Li
2022-01-26 22:00 ` John Daley (johndale) [this message]
2022-01-28 14:47   ` Ferruh Yigit
2022-02-02 11:50     ` Thomas Monjalon
2022-02-03 10:57       ` Ferruh Yigit
2022-02-03 11:11         ` Thomas Monjalon
2022-02-03 11:22           ` Ferruh Yigit
2022-02-03  8:26 ` Weiguo Li
2022-02-02 12:53 [PATCH] "  =?gb18030?B?wO7OrLn6?=

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB25358889F72E9873E1B80EF5CF209@BYAPR11MB2535.namprd11.prod.outlook.com \
    --to=johndale@cisco.com \
    --cc=dev@dpdk.org \
    --cc=liwg06@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).