diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-03-19 14:31:10 +0100 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2016-03-29 01:19:00 +0200 |
commit | 4b28038fd60d346337dcaca80c255db2724adf76 (patch) | |
tree | 0391e37b5b082b99b4b7d7b1ce96d98e6fbf72c3 /drivers/remoteproc | |
parent | Linux 4.6-rc1 (diff) | |
download | linux-4b28038fd60d346337dcaca80c255db2724adf76.tar.xz linux-4b28038fd60d346337dcaca80c255db2724adf76.zip |
remoteproc: st: fix check of syscon_regmap_lookup_by_phandle() return value
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>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/st_remoteproc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c index 6bb04d453247..6f056caa8a56 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, |