projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4b397f
)
drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation
author
Roy Spliet
<nouveau@spliet.org>
Tue, 7 Apr 2020 17:07:37 +0000
(18:07 +0100)
committer
Rob Clark
<robdclark@chromium.org>
Mon, 18 May 2020 16:26:32 +0000
(09:26 -0700)
When allocation for mdp5_kms fails, calling mdp5_destroy() leads to undefined
behaviour, likely a nullptr exception or use-after-free troubles.
Signed-off-by: Roy Spliet <nouveau@spliet.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
index
47b9898
..
c23a2fa
100644
(file)
--- a/
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
+++ b/
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
@@
-943,7
+943,8
@@
static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)
return 0;
fail:
- mdp5_destroy(pdev);
+ if (mdp5_kms)
+ mdp5_destroy(pdev);
return ret;
}