2017-04-26 03:20:24

by Heloise

[permalink] [raw]
Subject: [PATCH] mpt3sas_base:fix memory leak in _base_request_irq

Signed-off-by: Heloise <[email protected]>

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