From patchwork Wed Jan 23 08:20:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 2022951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8358DDF280 for ; Wed, 23 Jan 2013 09:19:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TxwSZ-0002MO-Cn; Wed, 23 Jan 2013 09:17:31 +0000 Received: from co1ehsobe001.messaging.microsoft.com ([216.32.180.184] helo=co1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TxwSV-0002L2-Gr; Wed, 23 Jan 2013 09:17:28 +0000 Received: from mail11-co1-R.bigfish.com (10.243.78.223) by CO1EHSOBE011.bigfish.com (10.243.66.74) with Microsoft SMTP Server id 14.1.225.23; Wed, 23 Jan 2013 09:17:24 +0000 Received: from mail11-co1 (localhost [127.0.0.1]) by mail11-co1-R.bigfish.com (Postfix) with ESMTP id 9A38118023D; Wed, 23 Jan 2013 09:17:24 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1ee6h1de0h1202h1e76h1d1ah1d2ah1082kzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h1354h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1155h) Received: from mail11-co1 (localhost.localdomain [127.0.0.1]) by mail11-co1 (MessageSwitch) id 1358932642123475_5306; Wed, 23 Jan 2013 09:17:22 +0000 (UTC) Received: from CO1EHSMHS022.bigfish.com (unknown [10.243.78.220]) by mail11-co1.bigfish.com (Postfix) with ESMTP id 11DFBB00091; Wed, 23 Jan 2013 09:17:22 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS022.bigfish.com (10.243.66.32) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 23 Jan 2013 09:17:21 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.318.3; Wed, 23 Jan 2013 09:17:21 +0000 Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r0N9HFxr024882; Wed, 23 Jan 2013 02:17:18 -0700 From: Huang Shijie To: Subject: [PATCH] mtd: gpmi: fix a dereferencing freed memory error Date: Wed, 23 Jan 2013 16:20:53 +0800 Message-ID: <1358929253-29143-1-git-send-email-b32955@freescale.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130123_041727_665052_EF10C320 X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.180.184 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Huang Shijie , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dedekind1@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The patch "490e280 mtd: gpmi-nand: Convert to module_platform_driver()" introduced a "dereferencing freed memory" error. This patch fixes it. Signed-off-by: Huang Shijie --- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 631564d..38c8b8b 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -1657,8 +1657,8 @@ exit_nfc_init: release_resources(this); exit_acquire_resources: platform_set_drvdata(pdev, NULL); - kfree(this); dev_err(this->dev, "driver registration failed: %d\n", ret); + kfree(this); return ret; }