All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Zheyu Ma <zheyuma97@gmail.com>,
	Himanshu Madhani <himanshu.madhani@oracle.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com,
	jejb@linux.ibm.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 3/9] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
Date: Mon, 25 Oct 2021 13:00:42 -0400	[thread overview]
Message-ID: <20211025170048.1394542-3-sashal@kernel.org> (raw)
In-Reply-To: <20211025170048.1394542-1-sashal@kernel.org>

From: Zheyu Ma <zheyuma97@gmail.com>

[ Upstream commit 06634d5b6e923ed0d4772aba8def5a618f44c7fe ]

The driver probing function should return < 0 for failure, otherwise
kernel will treat value > 0 as success.

Link: https://lore.kernel.org/r/1634522181-31166-1-git-send-email-zheyuma97@gmail.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/qla2xxx/qla_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 28cbefe715e5..657bcfb3cc9e 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4064,7 +4064,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 					ql_dbg_pci(ql_dbg_init, ha->pdev,
 					    0xe0ee, "%s: failed alloc dsd\n",
 					    __func__);
-					return 1;
+					return -ENOMEM;
 				}
 				ha->dif_bundle_kallocs++;
 
-- 
2.33.0


  parent reply	other threads:[~2021-10-25 17:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 17:00 [PATCH AUTOSEL 5.4 1/9] scsi: core: Put LLD module refcnt after SCSI device is released Sasha Levin
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 2/9] cavium: Return negative value when pci_alloc_irq_vectors() fails Sasha Levin
2021-10-25 17:00   ` Sasha Levin
2021-10-25 17:00 ` Sasha Levin [this message]
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 4/9] scsi: qla2xxx: Fix unmap of already freed sgl Sasha Levin
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 5/9] cavium: Fix return values of the probe function Sasha Levin
2021-10-25 17:00   ` Sasha Levin
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 6/9] vrf: Revert "Reset skb conntrack connection..." Sasha Levin
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 7/9] sfc: Don't use netif_info before net_device setup Sasha Levin
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 8/9] usbnet: sanity check for maxpacket Sasha Levin
2021-10-25 17:00 ` [PATCH AUTOSEL 5.4 9/9] hyperv/vmbus: include linux/bitops.h Sasha Levin

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=20211025170048.1394542-3-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=himanshu.madhani@oracle.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --cc=stable@vger.kernel.org \
    --cc=zheyuma97@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.