From: Wei Yongjun <weiyongjun1@huawei•com>
To: Adrian Hunter <adrian.hunter@intel•com>,
Ulf Hansson <ulf.hansson@linaro•org>,
Joel Stanley <joel@jms•id.au>, Andrew Jeffery <andrew@aj•id.au>
Cc: linux-mmc@vger•kernel.org, kernel-janitors@vger•kernel.org,
Wei Yongjun <weiyongjun1@huawei•com>,
linux-aspeed@lists•ozlabs.org,
linux-arm-kernel@lists•infradead.org
Subject: [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe()
Date: Mon, 26 Aug 2019 12:00:13 +0000 [thread overview]
Message-ID: <20190826120013.183435-1-weiyongjun1@huawei.com> (raw)
In case of error, the function of_platform_device_create() returns
NULL pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Fixes: 09eed7fffd33 ("mmc: Add support for the ASPEED SD controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei•com>
---
drivers/mmc/host/sdhci-of-aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
index 8bb095ca2fa9..d5acb5afc50f 100644
--- a/drivers/mmc/host/sdhci-of-aspeed.c
+++ b/drivers/mmc/host/sdhci-of-aspeed.c
@@ -261,9 +261,9 @@ static int aspeed_sdc_probe(struct platform_device *pdev)
struct platform_device *cpdev;
cpdev = of_platform_device_create(child, NULL, &pdev->dev);
- if (IS_ERR(cpdev)) {
+ if (!cpdev) {
of_node_put(child);
- ret = PTR_ERR(cpdev);
+ ret = -ENODEV;
goto err_clk;
}
}
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-08-26 11:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 12:00 Wei Yongjun [this message]
2019-08-26 13:03 ` [PATCH -next] mmc: aspeed: Fix return value check in aspeed_sdc_probe() Dan Carpenter
2019-08-26 23:37 ` Andrew Jeffery
2019-08-27 0:47 ` Julia Lawall
2019-08-27 13:49 ` Ulf Hansson
2019-08-26 23:40 ` Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190826120013.183435-1-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei$(echo .)com \
--cc=adrian.hunter@intel$(echo .)com \
--cc=andrew@aj$(echo .)id.au \
--cc=joel@jms$(echo .)id.au \
--cc=kernel-janitors@vger$(echo .)kernel.org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-aspeed@lists$(echo .)ozlabs.org \
--cc=linux-mmc@vger$(echo .)kernel.org \
--cc=ulf.hansson@linaro$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox