drm/komeda: return early if drm_universal_plane_init() fails.
authorLiviu Dudau <liviu.dudau@arm.com>
Thu, 2 Dec 2021 17:00:33 +0000 (17:00 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:31 +0000 (10:22 +0200)
commit3f2dc8106345e34bbf425d00dfb2ce708048b7e2
tree95e962eae7f18658b86166df121e83886b3ce196
parent042f8d5a13d270e1cbda3cde410a5544b5468306
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: 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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/arm/display/komeda/komeda_plane.c