Skip to contentSkip to conversation

bnx2x:Fix error handling and return statement in the function bnx2x_vf_init

PATCH Ariel Elior 1 participant 1 message Nov 19, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ariel Elior

author Acked-by
#1 lore raw
Quoted 46 lines

-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Thursday, November 19, 2015 5:31 AM
To: Ariel Elior <[email protected]>
Cc: netdev <[email protected]>; linux-kernel <[email protected]>
Subject: [PATCH] bnx2x:Fix error handling and return statement in the function bnx2x_vf_init

This fixes error handling and the return statement in the function bnx2x_vf_init to properly check and return the error code returned by the call to the function bnx2x_post_vf_bulletin in order to allow callers of bnx2x_vf_init to be properly signaled and be able to handle in their own intended error paths if a error code is returned by this particular function call.

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +1 -0
index 9d02734..4434cdb 100644
@@ -2087,6 +2087,7 @@ int bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf,
 dma_addr_t *sb_map)
 {
 	struct bnx2x_func_init_params func_init = {0};
 	int i;
+	int rc;
 
 	/* the sb resources are initialized at this point, do the
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +2 -2
 	 * FW/HW initializations
@@ -2129,9 +2130,9 @@ int bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf,
 dma_addr_t *sb_map)
 	vf->state = VF_ENABLED;
 
 	/* update vf bulletin board */
-	bnx2x_post_vf_bulletin(bp, vf->index);
+	rc = bnx2x_post_vf_bulletin(bp, vf->index);
 
-	return 0;
+	return rc;
 }
 
Quoted 3 lines

struct set_vf_state_cookie {
--
2.5.0