From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-ide@vger.kernel.org>
Cc: <damien.lemoal@opensource.wdc.com>, <arnd@arndb.de>,
<b.zolnierkie@samsung.com>, <robert.jarzmik@free.fr>
Subject: [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe()
Date: Sun, 24 Apr 2022 17:34:20 +0800 [thread overview]
Message-ID: <20220424093420.2129779-1-yangyingliang@huawei.com> (raw)
If devm_platform_ioremap_resource() fails, it never return
NULL pointer, replace the check with IS_ERR().
Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/ata/pata_palmld.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c
index 400e65190904..51caa2a427dd 100644
--- a/drivers/ata/pata_palmld.c
+++ b/drivers/ata/pata_palmld.c
@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)
/* remap drive's physical memory address */
mem = devm_platform_ioremap_resource(pdev, 0);
- if (!mem)
- return -ENOMEM;
+ if (IS_ERR(mem))
+ return PTR_ERR(mem);
/* request and activate power and reset GPIOs */
lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
--
2.25.1
next reply other threads:[~2022-04-24 9:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-24 9:34 Yang Yingliang [this message]
2022-04-24 16:55 ` [PATCH -next] ata: palmld: fix return value check in palmld_pata_probe() Sergey Shtylyov
2022-04-25 6:00 ` Yang Yingliang
2022-04-25 0:44 ` Damien Le Moal
2022-04-25 0:45 ` Damien Le Moal
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=20220424093420.2129779-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=arnd@arndb.de \
--cc=b.zolnierkie@samsung.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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