Skip to content

gpu/drm: fix memory leak when radeon_driver_load_kms fails

Xiaotian Feng lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4gpu/drm/radeon: fix memory leak in radeon_driver_load_kmsdrivers/gpu/drm/radeon/radeon_kms.c+2 -00 replies
2/4gpu/drm: fix memory leak in drm_fill_in_dev fail pathdrivers/gpu/drm/drm_stub.c+20 -50 replies
3/4gpu/drm: introduce drm_cleanup_dev to cleanup memories allocated from drm_fill_in_devdrivers/gpu/drm/drm_stub.c+27 -200 replies
4/4gpu/drm: fix memory leak if dev->driver->load failsdrivers/gpu/drm/drm_stub.c+8 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] gpu/drm: fix memory leak when radeon_driver_load_kms fails

I've noticed a bundle of kmemleak reports on drm. When I look into dmesg, I found: "[drm:radeon_driver_load_kms] *ERROR* Failed to initialize radeon, disabling IOCTL".

In radeon_driver_load_kms, if radeon_device_init fails, rdev is not freed. Then radeon_driver_load_kms as dev->driver->load, if load fails in drm_get_dev, memories allocated in drm_fill_in_dev will not be freed.

This patchset fixes those memory leaks, after this patchset applied, I didn't see those drm kmemleak report.