From: Brendan Higgins <brendanhiggins@google.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Joel Stanley <joel@jms.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>,
linux-i2c@vger.kernel.org,
OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init()
Date: Wed, 18 Oct 2017 18:01:27 -0700 [thread overview]
Message-ID: <CAFd5g46PbfU1OTVT7S5WsYUXt6itqRzf+6uU0ti6z+CAY0atNw@mail.gmail.com> (raw)
In-Reply-To: <1507719023-127618-1-git-send-email-weiyongjun1@huawei.com>
On Wed, Oct 11, 2017 at 3:50 AM, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> In case of error, the function of_iomap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test..
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/irqchip/irq-aspeed-i2c-ic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
> index 815b88d..f20200a 100644
> --- a/drivers/irqchip/irq-aspeed-i2c-ic.c
> +++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
> @@ -76,8 +76,8 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
> return -ENOMEM;
>
> i2c_ic->base = of_iomap(node, 0);
> - if (IS_ERR(i2c_ic->base)) {
> - ret = PTR_ERR(i2c_ic->base);
> + if (!i2c_ic->base) {
> + ret = -ENOMEM;
> goto err_free_ic;
> }
>
>
>
>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
prev parent reply other threads:[~2017-10-19 1:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 10:50 [PATCH] irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init() Wei Yongjun
2017-10-19 1:01 ` Brendan Higgins [this message]
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=CAFd5g46PbfU1OTVT7S5WsYUXt6itqRzf+6uU0ti6z+CAY0atNw@mail.gmail.com \
--to=brendanhiggins@google.com \
--cc=benh@kernel.crashing.org \
--cc=jason@lakedaemon.net \
--cc=joel@jms.id.au \
--cc=linux-i2c@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=openbmc@lists.ozlabs.org \
--cc=tglx@linutronix.de \
--cc=weiyongjun1@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).