Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aea74850 authored by Liviu Dudau's avatar Liviu Dudau Committed by Greg Kroah-Hartman
Browse files

drm/komeda: return early if drm_universal_plane_init() fails.



[ Upstream commit c8f76c37cc3668ee45e081e76a15f24a352ebbdd ]

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: default avatarSteven Price <steven.price@arm.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Signed-off-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/dri-devel/20211203100946.2706922-1-liviu.dudau@arm.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8ded0af9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -274,8 +274,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);