qed: initialize return rc to avoid returning garbage
authorColin Ian King <colin.king@canonical.com>
Tue, 29 Mar 2016 17:00:50 +0000 (18:00 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Mar 2016 19:48:15 +0000 (15:48 -0400)
in the case where qed_slowpath_irq_req is not called, rc is not
assigned and so qed_int_igu_enable will return a garbage value.
Fix this by initializing rc to 0.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_int.c

index ffd0accc2ec9efcac9a124401ef88a85dcffe99c..2017b0121f5f6a1f3139711bb0446ba4cad154e7 100644 (file)
@@ -2750,7 +2750,7 @@ void qed_int_igu_enable_int(struct qed_hwfn *p_hwfn,
 int qed_int_igu_enable(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
                       enum qed_int_mode int_mode)
 {
-       int rc;
+       int rc = 0;
 
        /* Configure AEU signal change to produce attentions */
        qed_wr(p_hwfn, p_ptt, IGU_REG_ATTENTION_ENABLE, 0);