[v2,1/2] eal: check mp reply result

Message ID 1619663653-22771-2-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series fix bugs for librte eal |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

humin (Q) April 29, 2021, 2:34 a.m. UTC
  This patch adds checking for mp reply result in handle_sync().

Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/eal/common/malloc_mp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Thomas Monjalon May 4, 2021, 4:54 p.m. UTC | #1
+Cc Anatoly

29/04/2021 04:34, Min Hu (Connor):
> This patch adds checking for mp reply result in handle_sync().
> 
> Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  lib/eal/common/malloc_mp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
> index c7101b3..2e597a1 100644
> --- a/lib/eal/common/malloc_mp.c
> +++ b/lib/eal/common/malloc_mp.c
> @@ -171,9 +171,7 @@ handle_sync(const struct rte_mp_msg *msg, const void *peer)
>  	resp->id = req->id;
>  	resp->result = ret == 0 ? REQ_RESULT_SUCCESS : REQ_RESULT_FAIL;
>  
> -	rte_mp_reply(&reply, peer);
> -
> -	return 0;
> +	return rte_mp_reply(&reply, peer);
>  }
  

Patch

diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index c7101b3..2e597a1 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -171,9 +171,7 @@  handle_sync(const struct rte_mp_msg *msg, const void *peer)
 	resp->id = req->id;
 	resp->result = ret == 0 ? REQ_RESULT_SUCCESS : REQ_RESULT_FAIL;
 
-	rte_mp_reply(&reply, peer);
-
-	return 0;
+	return rte_mp_reply(&reply, peer);
 }
 
 static int