Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] nvmet: fix a memory leak
@ 2020-07-30 20:55 Sagi Grimberg
  2020-08-02 22:44 ` Chaitanya Kulkarni
  0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2020-07-30 20:55 UTC (permalink / raw)
  To: linux-nvme, Christoph Hellwig, Keith Busch

We forgot to free new_model_number

Fixes: 013b7ebe5a0d ("nvmet: make ctrl model configurable")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 drivers/nvme/target/configfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 74b2b61c773b..37e1d7784e17 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -1136,6 +1136,7 @@ static ssize_t nvmet_subsys_attr_model_store(struct config_item *item,
 	up_write(&nvmet_config_sem);
 
 	kfree_rcu(new_model, rcuhead);
+	kfree(new_model_number);
 
 	return count;
 }
-- 
2.25.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH] nvmet: fix a memory leak
  2020-07-30 20:55 [PATCH] nvmet: fix a memory leak Sagi Grimberg
@ 2020-08-02 22:44 ` Chaitanya Kulkarni
  0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Kulkarni @ 2020-08-02 22:44 UTC (permalink / raw)
  To: Sagi Grimberg, linux-nvme, Christoph Hellwig, Keith Busch

On 7/30/20 14:02, Sagi Grimberg wrote:
> We forgot to free new_model_number
> 
> Fixes: 013b7ebe5a0d ("nvmet: make ctrl model configurable")
> Signed-off-by: Sagi Grimberg<sagi@grimberg.me>


Thanks for the fix, looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 20:55 [PATCH] nvmet: fix a memory leak Sagi Grimberg
2020-08-02 22:44 ` Chaitanya Kulkarni

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git