Commit 01a9e949 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Neil Armstrong

drm/meson: Fix an un-handled error path in 'meson_drv_bind_master()'

If 'platform_get_resource_byname()' fails, we should release some resources
before leaving, as already done in the other error handling path of the
function.

Fixes: acaa3f13 ("drm/meson: Fix potential NULL dereference in meson_drv_bind_master()")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180611165335.24542-1-christophe.jaillet@wanadoo.fr
parent 7daf201d
...@@ -197,8 +197,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) ...@@ -197,8 +197,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
priv->io_base = regs; priv->io_base = regs;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi");
if (!res) if (!res) {
return -EINVAL; ret = -EINVAL;
goto free_drm;
}
/* Simply ioremap since it may be a shared register zone */ /* Simply ioremap since it may be a shared register zone */
regs = devm_ioremap(dev, res->start, resource_size(res)); regs = devm_ioremap(dev, res->start, resource_size(res));
if (!regs) { if (!regs) {
...@@ -215,8 +217,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) ...@@ -215,8 +217,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
} }
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc");
if (!res) if (!res) {
return -EINVAL; ret = -EINVAL;
goto free_drm;
}
/* Simply ioremap since it may be a shared register zone */ /* Simply ioremap since it may be a shared register zone */
regs = devm_ioremap(dev, res->start, resource_size(res)); regs = devm_ioremap(dev, res->start, resource_size(res));
if (!regs) { if (!regs) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment