From patchwork Mon Jul 4 14:20:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 103108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9A9E8B6F68 for ; Tue, 5 Jul 2011 00:20:50 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qdk0i-0006Bo-Kd; Mon, 04 Jul 2011 14:20:28 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qdk0i-0002U4-9H; Mon, 04 Jul 2011 14:20:28 +0000 Received: from mgw2.diku.dk ([130.225.96.92]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qdk0d-0002Ti-AY for linux-mtd@lists.infradead.org; Mon, 04 Jul 2011 14:20:24 +0000 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 1B0C619BB97; Mon, 4 Jul 2011 16:20:21 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00676-10; Mon, 4 Jul 2011 16:20:17 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 1460B19BBAC; Mon, 4 Jul 2011 16:20:17 +0200 (CEST) From: Julia Lawall To: David Woodhouse Subject: [PATCH] drivers/mtd/lpddr/lpddr_cmds.c: eliminate double free Date: Mon, 4 Jul 2011 16:20:17 +0200 Message-Id: <1309789217-22947-1-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110704_102023_535676_5EC93A47 X-CRM114-Status: GOOD ( 10.77 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Joakim Tjernlund , Lucas De Marchi , Stefani Seibold , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Tadashi Abe X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Julia Lawall The only call to lpddr_cmdset is in the function defined in lpddr_probe drivers/mtd/lpddr/qinfo_probe.c. If the result of calling lpddr_cmdset is NULL, this function frees lpddr. So lpddr should not be freed in lpddr_cmdset. Signed-off-by: Julia Lawall --- drivers/mtd/lpddr/lpddr_cmds.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index 65655dd..b7f265e 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c @@ -89,7 +89,6 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) shared = kmalloc(sizeof(struct flchip_shared) * lpddr->numchips, GFP_KERNEL); if (!shared) { - kfree(lpddr); kfree(mtd); return NULL; }