Re: [PATCH 1/2] drm/drv: Fix potential memory leak in drm_dev_init()

2022-11-10 Thread Lyude Paul
Reviewed-by: Lyude Paul Will go ahead and push these two upstream, thanks! On Tue, 2022-11-01 at 15:07 +0800, Shang XiaoJing wrote: > drm_dev_init() will add drm_dev_init_release() as a callback. When > drmm_add_action() failed, the release function won't be added. As the > result, the ref cnt a

[PATCH 1/2] drm/drv: Fix potential memory leak in drm_dev_init()

2022-11-01 Thread Shang XiaoJing
drm_dev_init() will add drm_dev_init_release() as a callback. When drmm_add_action() failed, the release function won't be added. As the result, the ref cnt added by device_get() in drm_dev_init() won't be put by drm_dev_init_release(), which leads to the memleak. Use drmm_add_action_or_reset() ins