kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] bnxt_en: fix error path of FW reset
@ 2021-07-24 13:35 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-07-24 13:35 UTC (permalink / raw)
  To: somnath.kotur; +Cc: kernel-janitors

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-24 13:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 13:35 [bug report] bnxt_en: fix error path of FW reset Dan Carpenter

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).