From: Dan Carpenter <dan.carpenter@oracle.com>
To: somnath.kotur@broadcom.com
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] bnxt_en: fix error path of FW reset
Date: Sat, 24 Jul 2021 16:35:15 +0300 [thread overview]
Message-ID: <20210724133515.GA3293@kili> (raw)
Hello Somnath Kotur,
The patch 3958b1da725a: "bnxt_en: fix error path of FW reset" from
Jul 18, 2021, leads to the following static checker warning:
drivers/net/ethernet/broadcom/bnxt/bnxt.c:12135 bnxt_fw_reset_task()
warn: duplicate check 'rc' (previous on line 12123)
drivers/net/ethernet/broadcom/bnxt/bnxt.c
12117 case BNXT_FW_RESET_STATE_OPENING:
12118 while (!rtnl_trylock()) {
12119 bnxt_queue_fw_reset_work(bp, HZ / 10);
12120 return;
12121 }
12122 rc = bnxt_open(bp->dev);
12123 if (rc) {
12124 netdev_err(bp->dev, "bnxt_open() failed during FW reset\n");
12125 bnxt_fw_reset_abort(bp, rc);
12126 rtnl_unlock();
12127 return;
^^^^^^
The patch adds a new return
12128 }
12129
12130 bp->fw_reset_state = 0;
12131 /* Make sure fw_reset_state is 0 before clearing the flag */
12132 smp_mb__before_atomic();
12133 clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
12134 bnxt_ulp_start(bp, rc);
^^
rc is always zero
--> 12135 if (!rc)
^^^
no need to check any more
12136 bnxt_reenable_sriov(bp);
12137 bnxt_vf_reps_alloc(bp);
12138 bnxt_vf_reps_open(bp);
12139 bnxt_dl_health_recovery_done(bp);
12140 bnxt_dl_health_status_update(bp, true);
12141 rtnl_unlock();
12142 break;
12143 }
12144 return;
12145
12146 fw_reset_abort_status:
12147 if (bp->fw_health->status_reliable ||
12148 (bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY)) {
12149 u32 sts = bnxt_fw_health_readl(bp, BNXT_FW_HEALTH_REG);
12150
12151 netdev_err(bp->dev, "fw_health_status 0x%x\n", sts);
12152 }
12153 fw_reset_abort:
12154 rtnl_lock();
12155 bnxt_fw_reset_abort(bp, rc);
12156 rtnl_unlock();
12157 }
regards,
dan carpenter
reply other threads:[~2021-07-24 13:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210724133515.GA3293@kili \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=somnath.kotur@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).