From: Lee Jones <lee.jones@linaro.org>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
Ohad Ben-Cohen <ohad@wizery.com>,
Ludovic Barre <ludovic.barre@st.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remoteproc: st: fix check of syscon_regmap_lookup_by_phandle() return value
Date: Mon, 21 Mar 2016 11:54:03 +0000 [thread overview]
Message-ID: <20160321115403.GB4140@x1> (raw)
In-Reply-To: <1458394270-21938-1-git-send-email-vz@mleia.com>
On Sat, 19 Mar 2016, Vladimir Zapolskiy wrote:
> syscon_regmap_lookup_by_phandle() returns either a valid pointer to
> struct regmap or ERR_PTR() error value, check for NULL is invalid and
> on error path may lead to oops, the change corrects the check.
>
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> ---
> drivers/remoteproc/st_remoteproc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Lee Jones <lee.jones@linaro.org>
> diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
> index 6bb04d4..6f056ca 100644
> --- a/drivers/remoteproc/st_remoteproc.c
> +++ b/drivers/remoteproc/st_remoteproc.c
> @@ -189,9 +189,9 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
> }
>
> ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
> - if (!ddata->boot_base) {
> + if (IS_ERR(ddata->boot_base)) {
> dev_err(dev, "Boot base not found\n");
> - return -EINVAL;
> + return PTR_ERR(ddata->boot_base);
> }
>
> err = of_property_read_u32_index(np, "st,syscfg", 1,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2016-03-21 11:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-19 13:31 [PATCH] remoteproc: st: fix check of syscon_regmap_lookup_by_phandle() return value Vladimir Zapolskiy
2016-03-21 11:54 ` Lee Jones [this message]
2016-03-21 17:21 ` Bjorn Andersson
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=20160321115403.GB4140@x1 \
--to=lee.jones@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.barre@st.com \
--cc=ohad@wizery.com \
--cc=vz@mleia.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