# \[PATCH 1/1\] ehea: fix error return code in ehea\_restart\_qps()

- Subsystems: NETWORKING DRIVERS, THE REST
- Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
- Status: LANDED (015dbf5662fd · 2021-05-29 01:12)
- Landed in mainline as 015dbf5662fd on 2021-05-29.
- List: netdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/netdev/2021/05/1394950/t

## \[PATCH 1/1\] ehea: fix error return code in ehea\_restart\_qps()

- From: Zhen Lei \<hidden\>
- Date: 2021-05-28 08:56:32 
- Message: https://ratatoskr.run/netdev/2021/05/1394950.md

```text
Fix to return -EFAULT from the error handling case instead of 0, as done
elsewhere in this function.

By the way, when get_zeroed_page() fails, directly return -ENOMEM to
simplify code.

Fixes: 2c69448bbced ("ehea: DLPAR memory add fix")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Zhen Lei <redacted>
---
 drivers/net/ethernet/ibm/ehea/ehea_main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index ea55314b209d..d105bfbc7c1c 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -2618,10 +2618,8 @@ static int ehea_restart_qps(struct net_device *dev)
 	u16 dummy16 = 0;
 
 	cb0 = (void *)get_zeroed_page(GFP_KERNEL);
-	if (!cb0) {
-		ret = -ENOMEM;
-		goto out;
-	}
+	if (!cb0)
+		return -ENOMEM;
 
 	for (i = 0; i < (port->num_def_qps); i++) {
 		struct ehea_port_res *pr =  &port->port_res[i];
@@ -2641,6 +2639,7 @@ static int ehea_restart_qps(struct net_device *dev)
 					    cb0);
 		if (hret != H_SUCCESS) {
 			netdev_err(dev, "query_ehea_qp failed (1)\n");
+			ret = -EFAULT;
 			goto out;
 		}
 
@@ -2653,6 +2652,7 @@ static int ehea_restart_qps(struct net_device *dev)
 					     &dummy64, &dummy16, &dummy16);
 		if (hret != H_SUCCESS) {
 			netdev_err(dev, "modify_ehea_qp failed (1)\n");
+			ret = -EFAULT;
 			goto out;
 		}
 
@@ -2661,6 +2661,7 @@ static int ehea_restart_qps(struct net_device *dev)
 					    cb0);
 		if (hret != H_SUCCESS) {
 			netdev_err(dev, "query_ehea_qp failed (2)\n");
+			ret = -EFAULT;
 			goto out;
 		}
 
-- 
2.25.1


```

## Re: \[PATCH 1/1\] ehea: fix error return code in ehea\_restart\_qps()

- From: patchwork-bot+netdevbpf@kernel.org
- Date: 2021-05-29 01:25:36 
- Message: https://ratatoskr.run/netdev/2021/05/1395598.md

```text
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 28 May 2021 16:55:55 +0800 you wrote:
> Fix to return -EFAULT from the error handling case instead of 0, as done
> elsewhere in this function.
> 
> By the way, when get_zeroed_page() fails, directly return -ENOMEM to
> simplify code.
> 
> Fixes: 2c69448bbced ("ehea: DLPAR memory add fix")
> Reported-by: Hulk Robot <redacted>
> Signed-off-by: Zhen Lei <redacted>
> 
> [...]

Here is the summary with links:
  - [1/1] ehea: fix error return code in ehea_restart_qps()
    https://git.kernel.org/netdev/net-next/c/015dbf5662fd

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


```
