[PATCH] net: intel: iavf: fix error return code of iavf_init_get_resources()

Subsystems: intel ethernet drivers, networking drivers, the rest

STALE1978d

2 messages, 2 authors, 2021-03-05 · open the first message on its own page

[PATCH] net: intel: iavf: fix error return code of iavf_init_get_resources()

From: Jia-Ju Bai <hidden>
Date: 2021-03-05 03:10:20

When iavf_process_config() fails, no error return code of
iavf_init_get_resources() is assigned.
To fix this bug, err is assigned with the return value of 
iavf_process_config(), and then err is checked.

Reported-by: TOTE Robot <redacted>
Signed-off-by: Jia-Ju Bai <redacted>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 0a867d64d467..dc5b3c06d1e0 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -1776,7 +1776,8 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter)
 		goto err_alloc;
 	}
 
-	if (iavf_process_config(adapter))
+	err = iavf_process_config(adapter);
+	if (err)
 		goto err_alloc;
 	adapter->current_op = VIRTCHNL_OP_UNKNOWN;
 
-- 
2.17.1

Re: [PATCH] net: intel: iavf: fix error return code of iavf_init_get_resources()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-03-05 21:11:41

Hello:

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

On Thu,  4 Mar 2021 19:10:10 -0800 you wrote:
When iavf_process_config() fails, no error return code of
iavf_init_get_resources() is assigned.
To fix this bug, err is assigned with the return value of
iavf_process_config(), and then err is checked.

Reported-by: TOTE Robot <redacted>
Signed-off-by: Jia-Ju Bai <redacted>

[...]
Here is the summary with links:
  - net: intel: iavf: fix error return code of iavf_init_get_resources()
    https://git.kernel.org/netdev/net/c/6650d31f21b8

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help