]> git.baikalelectronics.ru Git - kernel.git/commit
drm/hisilicon: Code refactoring for hibmc_drv_de
authorTian Tao <tiantao6@hisilicon.com>
Wed, 12 Aug 2020 07:42:59 +0000 (15:42 +0800)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 12 Aug 2020 08:27:18 +0000 (10:27 +0200)
commit92d9f598e6bd3c8b11f7e370697b16c86ee90615
tree2ed1b7d54c2e6fb3e9d50d11cbca386ac8bc6024
parent47ce396def7fa3bd76d1dceddd07d1120b0a00b2
drm/hisilicon: Code refactoring for hibmc_drv_de

The memory used to be allocated with devres helpers and released
automatically. In rare circumstances, the memory's release could
have happened before the DRM device got released, which would have
caused memory corruption of some kind. Now we're embedding the data
structures in struct hibmc_drm_private. The whole release problem
has been resolved, because struct hibmc_drm_private is allocated
with drmm_kzalloc and always released with the DRM device.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1597218179-3938-3-git-send-email-tiantao6@hisilicon.com
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h