net/qla3xxx: fix an error code in ql_adapter_up()
PATCH 1/1 net/qla3xxx: fix an error code in ql_adapter_up()
The ql_wait_for_drvr_lock() fails and returns false, then this function should return an error code instead of returning success.
--- drivers/net/ethernet/qlogic/qla3xxx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/ethernet/qlogic/qla3xxx.c +10 -10
@@ -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);
Signature · 1 line
2.20.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
maintainerQuoted 2 lines · 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?
Quoted 9 lines · Jakub Kicinski
Quoted 2 lines · 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