diff mbox series

[-next] scsi: elx: efct: Fix error handling in efct_hw_init()

Message ID 20210617024837.1023069-1-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Commit 41962aba2dc622b456aaf3c20e1089084714f73f
Headers show
Series [-next] scsi: elx: efct: Fix error handling in efct_hw_init() | expand

Commit Message

Wei Yongjun June 17, 2021, 2:48 a.m. UTC
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, also fix typo in error message.

Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/scsi/elx/efct/efct_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Smart June 18, 2021, 10:51 p.m. UTC | #1
On 6/16/2021 7:48 PM, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, also fix typo in error message.
> 
> Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>   drivers/scsi/elx/efct/efct_hw.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Thanks

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james
Martin K. Petersen June 19, 2021, 2:29 a.m. UTC | #2
Wei,

> Fix to return negative error code -ENOMEM from the error handling case
> instead of 0, also fix typo in error message.

Applied to 5.14/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/elx/efct/efct_hw.c b/drivers/scsi/elx/efct/efct_hw.c
index ce4736c41564..6324683f9e8e 100644
--- a/drivers/scsi/elx/efct/efct_hw.c
+++ b/drivers/scsi/elx/efct/efct_hw.c
@@ -1044,8 +1044,8 @@  efct_hw_init(struct efct_hw *hw)
 	 */
 	hw->wq_reqtag_pool = efct_hw_reqtag_pool_alloc(hw);
 	if (!hw->wq_reqtag_pool) {
-		efc_log_err(hw->os, "efct_hw_reqtag_init failed %d\n", rc);
-		return rc;
+		efc_log_err(hw->os, "efct_hw_reqtag_pool_alloc failed\n");
+		return -ENOMEM;
 	}
 
 	rc = efct_hw_setup_io(hw);