From patchwork Mon Apr 4 02:48:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 684521 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p342oI9O011884 for ; Mon, 4 Apr 2011 02:50:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753688Ab1DDCuY (ORCPT ); Sun, 3 Apr 2011 22:50:24 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:51767 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753679Ab1DDCuY (ORCPT ); Sun, 3 Apr 2011 22:50:24 -0400 Received: from epmmp2 (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LJ300JVHX7X4650@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Mon, 04 Apr 2011 11:50:21 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LJ3005UFX7YYE@mmp2.samsung.com> for linux-mmc@vger.kernel.org; Mon, 04 Apr 2011 11:50:22 +0900 (KST) Received: from [165.213.219.108] ([165.213.219.108]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Mon, 04 Apr 2011 11:50:21 +0900 Date: Mon, 04 Apr 2011 11:48:57 +0900 From: Jaehoon Chung Subject: [PATCH] mmc: sdhci: add error checking for mmc_add_host To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , Kyungmin Park Message-id: <4D993199.1060206@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Thunderbird 2.0.0.24 (X11/20100317) X-OriginalArrivalTime: 04 Apr 2011 02:50:21.0892 (UTC) FILETIME=[0A587040:01CBF273] Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 04 Apr 2011 02:50:25 +0000 (UTC) Sometimes we can't add the device,but we didn't check any error status. Need to check error status for mmc_add_host. Signed-off-by: Jaehoon Chung Signed-off-by: kyungmin Park --- drivers/mmc/host/sdhci.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9e15f41..9c777bc 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2025,7 +2025,9 @@ int sdhci_add_host(struct sdhci_host *host) mmiowb(); - mmc_add_host(mmc); + ret = mmc_add_host(mmc); + if (unlikely(ret)) + goto err_free_mmc; printk(KERN_INFO "%s: SDHCI controller on %s [%s] using %s\n", mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), @@ -2041,6 +2043,9 @@ reset: sdhci_reset(host, SDHCI_RESET_ALL); free_irq(host->irq, host); #endif +err_free_mmc: + mmc_free_host(host); + untasklet: tasklet_kill(&host->card_tasklet); tasklet_kill(&host->finish_tasklet);