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: 3352051 Return-Path: X-Original-To: patchwork-linux-mmc@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 D5E31C0D4A for ; Mon, 16 Dec 2013 06:12:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 137522037F for ; Mon, 16 Dec 2013 06:12:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0683A2037D for ; Mon, 16 Dec 2013 06:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993Ab3LPGMO (ORCPT ); Mon, 16 Dec 2013 01:12:14 -0500 Received: from mail-bk0-f54.google.com ([209.85.214.54]:42722 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750935Ab3LPGL7 (ORCPT ); Mon, 16 Dec 2013 01:11:59 -0500 Received: by mail-bk0-f54.google.com with SMTP id v16so2149781bkz.41 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 Cc: yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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(-) -- 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/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"); }