From patchwork Mon Dec 16 06:11:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3352061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B24E2C0D4A for ; Mon, 16 Dec 2013 06:12:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEA042037F for ; Mon, 16 Dec 2013 06:12:48 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECD502037D for ; Mon, 16 Dec 2013 06:12:47 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsRPo-0006ZS-PG; Mon, 16 Dec 2013 06:12:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsRPm-0001Fp-8l; Mon, 16 Dec 2013 06:12:26 +0000 Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsRPj-0001Ei-Hu for linux-arm-kernel@lists.infradead.org; Mon, 16 Dec 2013 06:12:24 +0000 Received: by mail-bk0-f45.google.com with SMTP id mx13so2170083bkb.32 for ; Sun, 15 Dec 2013 22:11:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=VY/AAoUgurJfKKKVWZxa6NjgWIDhZCVOTpWbfm+bzCQ=; b=acWq+4VDa3ynHeFzYl+t5evtwwYiru/+5ctwCti95DZOIinuERBxR/8+cNj/C3mU1z Sz2EbiPG61hruta5hJug2n/DLXvnsZnlGxsPeBe11A2SAJp7gsinjfJUSwlblUq/wkyi 3Syd5rtWqZYulT6MBmNEcnsF2Oogcmf5pqe2n9Yia4mP+lwkLZx+0DhHX/ZpmCjBACtV mriEZv8jWPA+b+cKq1X2MyXSv24i5tyggid6QUbKCnAY66ERW8q2lDrxzWn0A0n5JjP9 7qVWK6wbQu3xednw6XlKKKRnG7Dmfi9f8A0yZ/SPhpkwdKJoVJVekl5ykpAK4jBStiv3 uOUg== MIME-Version: 1.0 X-Received: by 10.204.101.68 with SMTP id b4mr4520692bko.20.1387174318437; Sun, 15 Dec 2013 22:11:58 -0800 (PST) Received: by 10.204.74.130 with HTTP; Sun, 15 Dec 2013 22:11:58 -0800 (PST) Date: Mon, 16 Dec 2013 14:11:58 +0800 Message-ID: Subject: [PATCH -next] mmc: s3cmci: fix return value check in s3cmci_debugfs_attach() From: Wei Yongjun To: ben-linux@fluff.org, cjb@laptop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131216_011223_760953_223E8467 X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function debugfs_create_*() returns NULL pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/mmc/host/s3cmci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 2fce5ea..ca6e30f 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c @@ -1586,7 +1586,7 @@ static void s3cmci_debugfs_attach(struct s3cmci_host *host) struct device *dev = &host->pdev->dev; host->debug_root = debugfs_create_dir(dev_name(dev), NULL); - if (IS_ERR(host->debug_root)) { + if (!host->debug_root) { dev_err(dev, "failed to create debugfs root\n"); return; } @@ -1595,14 +1595,14 @@ static void s3cmci_debugfs_attach(struct s3cmci_host *host) host->debug_root, host, &s3cmci_fops_state); - if (IS_ERR(host->debug_state)) + if (!host->debug_state) dev_err(dev, "failed to create debug state file\n"); host->debug_regs = debugfs_create_file("regs", 0444, host->debug_root, host, &s3cmci_fops_regs); - if (IS_ERR(host->debug_regs)) + if (!host->debug_regs) dev_err(dev, "failed to create debug regs file\n"); }