diff mbox series

[net-next] net/qla3xxx: fix an error code in ql_adapter_up()

Message ID 20211203100300.GF2480@kili (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/qla3xxx: fix an error code in ql_adapter_up() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: akpm@osdl.org; 1 maintainers not CCed: akpm@osdl.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 30 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter Dec. 3, 2021, 10:03 a.m. UTC
The ql_wait_for_drvr_lock() fails and returns false, then this
function should return an error code instead of returning success.

Fixes: 5a4faa873782 ("[PATCH net-next] qla3xxx NIC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/qlogic/qla3xxx.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Dan Carpenter Dec. 3, 2021, 10:10 a.m. UTC | #1
I had intended to put [PATCH net] in the subject.  Although it's not a
high priority bug so net-next is fine too.

regards,
dan carpenter
Jakub Kicinski Dec. 7, 2021, 12:54 a.m. UTC | #2
On Fri, 3 Dec 2021 13:10:25 +0300 Dan Carpenter wrote:
> I had intended to put [PATCH net] in the subject.  Although it's not a
> high priority bug so net-next is fine too.

Looks like it's marked 'Changes Requested' in pw. The Fixes tag is also
incorrect (the subject does not match, there's a [PATCH] in it, which
seems to have been replaced by [PATCH net-next]). 

Would you mind reposting?
Dan Carpenter Dec. 7, 2021, 6:50 a.m. UTC | #3
On Mon, Dec 06, 2021 at 04:54:03PM -0800, Jakub Kicinski wrote:
> On Fri, 3 Dec 2021 13:10:25 +0300 Dan Carpenter wrote:
> > I had intended to put [PATCH net] in the subject.  Although it's not a
> > high priority bug so net-next is fine too.
> 
> Looks like it's marked 'Changes Requested' in pw. The Fixes tag is also
> incorrect (the subject does not match, there's a [PATCH] in it, which
> seems to have been replaced by [PATCH net-next]). 
> 
> Would you mind reposting?

Doh!

I will repost.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index 1e6d72adfe43..0642cc27094b 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -3480,20 +3480,20 @@  static int ql_adapter_up(struct ql3_adapter *qdev)
 
 	spin_lock_irqsave(&qdev->hw_lock, hw_flags);
 
-	err = ql_wait_for_drvr_lock(qdev);
-	if (err) {
-		err = ql_adapter_initialize(qdev);
-		if (err) {
-			netdev_err(ndev, "Unable to initialize adapter\n");
-			goto err_init;
-		}
-		netdev_err(ndev, "Releasing driver lock\n");
-		ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);
-	} else {
+	if (!ql_wait_for_drvr_lock(qdev)) {
 		netdev_err(ndev, "Could not acquire driver lock\n");
+		err = -ENODEV;
 		goto err_lock;
 	}
 
+	err = ql_adapter_initialize(qdev);
+	if (err) {
+		netdev_err(ndev, "Unable to initialize adapter\n");
+		goto err_init;
+	}
+	netdev_err(ndev, "Releasing driver lock\n");
+	ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);
+
 	spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
 
 	set_bit(QL_ADAPTER_UP, &qdev->flags);