summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/arm/display
diff options
context:
space:
mode:
authorLiviu Dudau <liviu.dudau@arm.com>2021-12-02 17:00:33 +0000
committerLiviu Dudau <liviu.dudau@arm.com>2022-04-11 18:30:18 +0100
commitc8f76c37cc3668ee45e081e76a15f24a352ebbdd (patch)
tree754131460d57d5a861374c77020e0ea00afcd319 /drivers/gpu/drm/arm/display
parentf5e284bb74ab296f98122673c7ecd22028b2c200 (diff)
downloadlinux-stable-c8f76c37cc3668ee45e081e76a15f24a352ebbdd.tar.gz
linux-stable-c8f76c37cc3668ee45e081e76a15f24a352ebbdd.tar.bz2
linux-stable-c8f76c37cc3668ee45e081e76a15f24a352ebbdd.zip
drm/komeda: return early if drm_universal_plane_init() fails.
If drm_universal_plane_init() fails early we jump to the common cleanup code that calls komeda_plane_destroy() which in turn could access the uninitalised drm_plane and crash. Return early if an error is detected without going through the common code. Reported-by: Steven Price <steven.price@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://lore.kernel.org/dri-devel/20211203100946.2706922-1-liviu.dudau@arm.com
Diffstat (limited to 'drivers/gpu/drm/arm/display')
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_plane.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
index 9a8197a23c45..e0b9f7063b20 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
@@ -270,8 +270,10 @@ static int komeda_plane_add(struct komeda_kms_dev *kms,
komeda_put_fourcc_list(formats);
- if (err)
- goto cleanup;
+ if (err) {
+ kfree(kplane);
+ return err;
+ }
drm_plane_helper_add(plane, &komeda_plane_helper_funcs);