]> git.baikalelectronics.ru Git - kernel.git/commit
drm: arm: malidp: Don't destroy planes manually in error handlers
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 17 Jan 2018 21:55:29 +0000 (23:55 +0200)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Wed, 14 Mar 2018 11:38:02 +0000 (11:38 +0000)
commit1435167578d060c9ac552081836ced35af7a3753
tree30c85a60e3348424083ad8b4f41108cc1d863a1d
parent7a19a1c80b17f0861a9289d04201a29fd01ee3da
drm: arm: malidp: Don't destroy planes manually in error handlers

The top-level error handler calls drm_mode_config_cleanup() which will
destroy all planes. There's no need to destroy them manually in lower
error handlers.

As plane cleanup is now handled entirely by drm_mode_config_cleanup(),
we must ensure that the plane .destroy() handler frees allocated memory
for the plane object that was freed by malidp_de_planes_destroy(). Do so
by replacing the call to devm_kfree() in the .destroy() handler by
kfree(). devm_kfree() is currently a no-op as the plane memory is
allocated with kzalloc(), not devm_kzalloc().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/arm/malidp_crtc.c
drivers/gpu/drm/arm/malidp_drv.c
drivers/gpu/drm/arm/malidp_drv.h
drivers/gpu/drm/arm/malidp_planes.c