]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
drm/v3d: Use drmm_add_final_kfree
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 23 Mar 2020 14:49:09 +0000 (15:49 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Mar 2020 14:18:11 +0000 (15:18 +0100)
commitea3aa6203c6b5540c80527d6beae68063a0080c1
tree09e54741f863da5b88150f0f514787a1dc78b09a
parentb6097727ae57dc782900e5955ac03c5d6158b28d
drm/v3d: Use drmm_add_final_kfree

With this we can drop the final kfree from the release function.

I also noticed that the unwind code is wrong, after drm_dev_init the
drm_device owns the v3d allocation, so the kfree(v3d) is a double-free.
Reorder the setup to fix this issue.

After a bit more prep in drivers and drm core v3d should be able to
switch over to devm_drm_dev_init, which should clean this up further.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-11-daniel.vetter@ffwll.ch
drivers/gpu/drm/v3d/v3d_drv.c