mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mpt3sas_base:fix memory leak in _base_request_irq
@ 2017-04-26  3:11 Heloise
  0 siblings, 0 replies; only message in thread
From: Heloise @ 2017-04-26  3:11 UTC (permalink / raw)
  To: sathya.prakash, chaitra.basappa, suganath-prabu.subramani, jejb,
	martin.petersen
  Cc: MPT-FusionLinux.pdl, linux-scsi, linux-kernel, Heloise

Signed-off-by: Heloise <os@iscas.ac.cn>

In function _base_request_irq, variable reply_q applies for memory
space 'reply_q=kzalloc()', but does not release it before the function
returns, fix it.
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 5b7aec5..801dfab 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1884,6 +1884,7 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index)
 
 	INIT_LIST_HEAD(&reply_q->list);
 	list_add_tail(&reply_q->list, &ioc->reply_queue_list);
+	kfree(reply_q);
 	return 0;
 }
 
-- 
2.1.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-26  3:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26  3:11 [PATCH] mpt3sas_base:fix memory leak in _base_request_irq Heloise

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

all inboxes | Powered by JetHome®