public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/1] nvme: return err on nvme_init_non_mdts_limits fail
       [not found] <CGME20221102172041eucas1p2d34f85a83d3dd5a8d110c26a88e187a8@eucas1p2.samsung.com>
@ 2022-11-02 17:17 ` Joel Granados
  2022-11-02 17:17   ` [PATCH 1/1] " Joel Granados
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Granados @ 2022-11-02 17:17 UTC (permalink / raw)
  To: kbusch, sagi, hch; +Cc: gost.dev, linux-nvme, Joel Granados

This patch was part of an RFC that I previously posted
https://lore.kernel.org/all/20221027155724.1161670-1-j.granados@samsung.com/
but it generated some discussion so I decided to send it out by itself.

In nvme_init_non_mdts_limits function we are returning 0 on kzalloc
failure; it should be returns -ENOMEM.  Introduced in: 5befc7c26e5a ("nvme:
implement non-mdts command limits")

Joel Granados (1):
  nvme: return err on nvme_init_non_mdts_limits fail

 drivers/nvme/host/core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.30.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] nvme: return err on nvme_init_non_mdts_limits fail
  2022-11-02 17:17 ` [PATCH 0/1] nvme: return err on nvme_init_non_mdts_limits fail Joel Granados
@ 2022-11-02 17:17   ` Joel Granados
  2022-11-02 18:19     ` Chaitanya Kulkarni
  2022-11-15 10:18     ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Granados @ 2022-11-02 17:17 UTC (permalink / raw)
  To: kbusch, sagi, hch; +Cc: gost.dev, linux-nvme, Joel Granados

In nvme_init_non_mdts_limits function we were returning 0 when kzalloc
failed; it now returns -ENOMEM.
Fixes: 5befc7c26e5a ("nvme: implement non-mdts command limits")

Signed-off-by: Joel Granados <j.granados@samsung.com>
---
 drivers/nvme/host/core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 0090dc0b3ae6..e02a7ca2ed57 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3049,8 +3049,10 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 		return 0;
 
 	id = kzalloc(sizeof(*id), GFP_KERNEL);
-	if (!id)
-		return 0;
+	if (!id) {
+		ret = -ENOMEM;
+		goto out;
+	}
 
 	c.identify.opcode = nvme_admin_identify;
 	c.identify.cns = NVME_ID_CNS_CS_CTRL;
@@ -3068,6 +3070,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 
 free_data:
 	kfree(id);
+out:
 	return ret;
 }
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] nvme: return err on nvme_init_non_mdts_limits fail
  2022-11-02 17:17   ` [PATCH 1/1] " Joel Granados
@ 2022-11-02 18:19     ` Chaitanya Kulkarni
  2022-11-15 10:18     ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2022-11-02 18:19 UTC (permalink / raw)
  To: Joel Granados, kbusch@kernel.org, sagi@grimberg.me, hch@lst.de
  Cc: gost.dev@samsung.com, linux-nvme@lists.infradead.org

On 11/2/22 10:17, Joel Granados wrote:
> In nvme_init_non_mdts_limits function we were returning 0 when kzalloc
> failed; it now returns -ENOMEM.
> Fixes: 5befc7c26e5a ("nvme: implement non-mdts command limits")
> 
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] nvme: return err on nvme_init_non_mdts_limits fail
  2022-11-02 17:17   ` [PATCH 1/1] " Joel Granados
  2022-11-02 18:19     ` Chaitanya Kulkarni
@ 2022-11-15 10:18     ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-11-15 10:18 UTC (permalink / raw)
  To: Joel Granados; +Cc: kbusch, sagi, hch, gost.dev, linux-nvme

Thanks,

applied to nvme-6.2 after dropping the pointless goto.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-15 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20221102172041eucas1p2d34f85a83d3dd5a8d110c26a88e187a8@eucas1p2.samsung.com>
2022-11-02 17:17 ` [PATCH 0/1] nvme: return err on nvme_init_non_mdts_limits fail Joel Granados
2022-11-02 17:17   ` [PATCH 1/1] " Joel Granados
2022-11-02 18:19     ` Chaitanya Kulkarni
2022-11-15 10:18     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox