Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756492AbcDDUP6 (ORCPT ); Mon, 4 Apr 2016 16:15:58 -0400 Received: from mail-am1on0071.outbound.protection.outlook.com ([157.56.112.71]:61762 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756457AbcDDUPz (ORCPT ); Mon, 4 Apr 2016 16:15:55 -0400 X-Greylist: delayed 8338 seconds by postgrey-1.27 at vger.kernel.org; Mon, 04 Apr 2016 16:15:54 EDT Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; From: Han Xu To: , , , , CC: , Subject: [PATCH] mtd: gpmi: fix raw_buffer pointer double free issue Date: Mon, 4 Apr 2016 12:25:10 -0500 Message-ID: <1459790710-25747-1-git-send-email-han.xu@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.168.49] X-ClientProxiedBy: BLUPR01CA049.prod.exchangelabs.com (10.160.23.39) To DB5PR0401MB1798.eurprd04.prod.outlook.com (10.165.5.152) X-MS-Office365-Filtering-Correlation-Id: e19d0088-9cb9-458a-01c3-08d35cb0761f X-Microsoft-Exchange-Diagnostics: 1;DB5PR0401MB1798;2:pF9TjBgpOWwIolINW8/aOKm8W0UgrHMj2Rlc6NiRuwluinA0y6qbby3f3Y+FE+2YAt4ZARpUy3+b7Gpn8YhxRrvK/oaJxi/LTtHDxXw07rwvu2dEaoWKW6OIf/teA8t2fT/tSh3sdIWYW+pSMUTtH09vqZloioIASQc4BVUnNC/BMd4+ayDOovVqov7Bttzh;3:Uz2ZikcNxxWBHFQwCP6we+Jp7yaddNXwsJ926L9Bhm7CPYzemZ3HcviwPswUd55cV2I6jBNx1aw07r2b4sOby6/IVOTX7/vE44tRvKVNLITn6L3MI6HjH9xPJy2RJJjR;25:HkgNXQ7mSBh3JFILOtBuow9pfu4CmIQ52go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+01VrThKp+3poSE9rHW9ZE0XkCK2otVR5ZuGQ6F8dfk1IZhaU56krW9OAlEdTSVeMNSQKvpvZuPBHLD82qT3nlfCH22YpQWN+dMKl+TAfX/9E/rC8uTK;4:rw2S22cWjafIIKww1hw0G2/QQdnurhkJnRkDKdFLWdRIjEudWtO98427hTzAOf/mXCyzIpfhDvW9ryskeysrqrAJMrvsd9ccRaxMs7T5gEDxfH0Kttx0FuWWOAXsFruqLORneBsYo6jNOg6b0joFFNqljSXPuuk8htWckCS/PwXrFxm4mBzAk5eCXGTzsnGxs0VppRLmC4ZPvsbtIVunmdt21vhCaeSWLUoBpJbHuREF0y4zAMG3hRtSxH4gGRH53yoHzog4BSPiJiSdBtd2AvdGCl48UO/3ZDafYRwzIPC6O29Fgt8OVtewlsKteqsAjiKiIqbbrFGsGtfUJoucZAzewRlPey3rdExAtb6UuA+/NwjzZsf9zTbLc3WM56rG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:DB5PR0401MB1798;BCL:0;PCL:0;RULEID:;SRVR:DB5PR0401MB1798; X-Forefront-PRVS: 0902222726 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(81166005)(5003940100001)(5004730100002)(86362001)(5008740100001)(92566002)(2201001)(50226001)(229853001)(3846002)(586003)(33646002)(42186005)(6116002)(77096005)(2906002)(189998001)(50986999)(48376002)(4326007)(1096002)(50466002)(66066001)(36756003)(47776003)(19580395003)(19580405001)(5001770100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR0401MB1798;H:chopperman.am.freescale.net;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DB5PR0401MB1798;23:X4egsEWZfD1NyvrP6HsDWUIuG83kzROQdQ5B3yT0PlVY0Ib2fXBlYoeAjjv5dDomaOJT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JcNPsfEeAJiuK5NrA1QoKsWg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2016 17:42:14.3238 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0401MB1798 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 647 Lines: 21 fix the raw_buffer pointer double free issue found by coverify. Signed-off-by: Han Xu --- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 8122c69..dcb60b0 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -797,6 +797,7 @@ static void gpmi_free_dma_buffer(struct gpmi_nand_data *this) this->cmd_buffer = NULL; this->data_buffer_dma = NULL; + this->raw_buffer = NULL; this->page_buffer_virt = NULL; this->page_buffer_size = 0; } -- 1.9.1