Commit 5c3ce69b authored by Jeffrey Hugo's avatar Jeffrey Hugo Committed by Greg Kroah-Hartman

drm/msm/mdp5: Fix mdp5_cfg_init error return

[ Upstream commit fc19cbb7 ]

If mdp5_cfg_init fails because of an unknown major version, a null pointer
dereference occurs.  This is because the caller of init expects error
pointers, but init returns NULL on error.  Fix this by returning the
expected values on error.

Fixes: 2e362e17 (drm/msm/mdp5: introduce mdp5_cfg module)
Signed-off-by: default avatarJeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ad244fd0
......@@ -635,7 +635,7 @@ struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms,
if (cfg_handler)
mdp5_cfg_destroy(cfg_handler);
return NULL;
return ERR_PTR(ret);
}
static struct mdp5_cfg_platform *mdp5_get_config(struct platform_device *dev)
......
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