提交 01a9e949 编写于 作者: C Christophe JAILLET 提交者: 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: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: NNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180611165335.24542-1-christophe.jaillet@wanadoo.fr
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册