]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/msm/mdp5: Fix mdp5_cfg_init error return
authorJeffrey Hugo <jeffrey.l.hugo@gmail.com>
Tue, 21 May 2019 15:00:30 +0000 (08:00 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit fc19cbb785d7bbd1a1af26229b5240a3ab332744 ]

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: 2e362e1772b8 (drm/msm/mdp5: introduce mdp5_cfg module)
Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c

index 824067d2d4277d36699b1f15c6d58f74a97fe23f..42f0ecb0cf35fd406a4115355c81aac93f7310af 100644 (file)
@@ -635,7 +635,7 @@ fail:
        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)