Skip to content

Commit

Permalink
drm/komeda: return early if drm_universal_plane_init() fails.
Browse files Browse the repository at this point in the history
[ Upstream commit c8f76c3 ]

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>
  • Loading branch information
dliviu authored and gregkh committed Jun 9, 2022
1 parent cd97a48 commit c977d63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/arm/display/komeda/komeda_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c977d63

Please sign in to comment.