From: Vladimir Zapolskiy <vz@mleia.com>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Abhilash Kesavan <a.kesavan@samsung.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] misc: sram: fix check of devm_ioremap_wc() return value
Date: Mon, 7 Mar 2016 02:41:56 +0200 [thread overview]
Message-ID: <1457311316-25401-1-git-send-email-vz@mleia.com> (raw)
The devm_ioremap_wc() function returns either a valid pointer to iomem
region or NULL, check for IS_ERR() is bogus.
The problem was introduced by commit 0ab163ad1ea0 ("misc: sram: switch
to ioremap_wc from ioremap") and it survived after the recent MMIO
SRAM driver refactoring.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
drivers/misc/sram.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 736dae7..9174623 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -361,8 +361,8 @@ static int sram_probe(struct platform_device *pdev)
}
sram->virt_base = devm_ioremap_wc(sram->dev, res->start, size);
- if (IS_ERR(sram->virt_base))
- return PTR_ERR(sram->virt_base);
+ if (!sram->virt_base)
+ return -ENOMEM;
sram->pool = devm_gen_pool_create(sram->dev, ilog2(SRAM_GRANULARITY),
NUMA_NO_NODE, NULL);
--
2.1.4
reply other threads:[~2016-03-07 0:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1457311316-25401-1-git-send-email-vz@mleia.com \
--to=vz@mleia.com \
--cc=a.kesavan@samsung.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®