netdev: broadcom: propagate error code
authorPan Bian <bianpan2016@163.com>
Sat, 3 Dec 2016 09:56:17 +0000 (17:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Dec 2016 18:25:38 +0000 (13:25 -0500)
Function bnxt_hwrm_stat_ctx_alloc() always returns 0, even if the call
to _hwrm_send_message() fails. It may be better to propagate the errors
to the caller of bnxt_hwrm_stat_ctx_alloc().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188661

Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index ee1a803aa11a3cb505a5b95efcf6069fa01ae201..f08a20b921e7a66f7738c65becb9993523452634 100644 (file)
@@ -4120,7 +4120,7 @@ static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
                bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id;
        }
        mutex_unlock(&bp->hwrm_cmd_lock);
-       return 0;
+       return rc;
 }
 
 static int bnxt_hwrm_func_qcfg(struct bnxt *bp)