Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1434782AbdDZDUY (ORCPT ); Tue, 25 Apr 2017 23:20:24 -0400 Received: from m12-18.163.com ([220.181.12.18]:42166 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1434766AbdDZDUO (ORCPT ); Tue, 25 Apr 2017 23:20:14 -0400 From: Heloise To: sathya.prakash@broadcom.com, chaitra.basappa@broadcom.com, suganath-prabu.subramani@broadcom.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Heloise Subject: [PATCH] mpt3sas_base:fix memory leak in _base_request_irq Date: Tue, 25 Apr 2017 20:11:43 -0700 Message-Id: <1493176303-9491-1-git-send-email-os@iscas.ac.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: EsCowAD3o720EQBZ0RC4Ag--.21799S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruF1ktFyxKr4xKrWxtw1kKrg_yoW3GFbEgw 42qFyxX348KF4UX3W0vry5JrWv9rW8Xwn7urZ0v3WfCF1DuFsFgFZrAwn8tr4UGrW7Ka4U CF1UG3yxCr1UAjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUe5EfUUUUUU== X-Originating-IP: [124.16.139.198] X-CM-SenderInfo: xnhu0vxosd3uhkbx1vxdwhqiywtou0bp/xtbBiBTFglaDuEGwhAAAsD Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 695 Lines: 24 Signed-off-by: Heloise 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