On 06/12, Dmitry Baryshkov wrote: > Currently memory used for writeback connectors isn't freed on driver > unbinding, leaking the memory. Use drm_device-memory allocation > function for the writeback connector, making sure that the memory is > freed on the driver unbinding. > > Reported-by: Christophe JAILLET <[email protected]> > Suggested-by: Alex Hung <[email protected]> > Signed-off-by: Dmitry Baryshkov <[email protected]> > --- > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > index ece581609cf7..436562e32e63 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -91,6 +91,7 @@ > #include <drm/drm_fourcc.h> > #include <drm/drm_edid.h> > #include <drm/drm_eld.h> > +#include <drm/drm_managed.h> > #include <drm/drm_mode.h> > #include <drm/drm_utils.h> > #include <drm/drm_vblank.h> > @@ -5807,7 +5808,7 @@ static int amdgpu_dm_initialize_drm_device(struct > amdgpu_device *adev) > link = dc_get_link_at_index(dm->dc, i); > > if (link->connector_signal == SIGNAL_TYPE_VIRTUAL) { > - struct amdgpu_dm_wb_connector *wbcon = > kzalloc_obj(*wbcon); > + struct amdgpu_dm_wb_connector *wbcon = > drmm_kzalloc_obj(adev_to_drm(adev), *wbcon); > > if (!wbcon) { > drm_err(adev_to_drm(adev), "KMS: Failed to > allocate writeback connector\n"); > @@ -5816,7 +5817,7 @@ static int amdgpu_dm_initialize_drm_device(struct > amdgpu_device *adev) > > if (amdgpu_dm_wb_connector_init(dm, wbcon, i)) { > drm_err(adev_to_drm(adev), "KMS: Failed to > initialize writeback connector\n"); > - kfree(wbcon); > + drmm_kfree(wbcon);
Hi Dmitry, It looks like drmm_kfree is missing one parameter. It looks like it should be something like this: drmm_kfree(&adev->ddev, wbcon); If I missed a new series where you address this issue, please ignore this comment. Thanks > continue; > } > > > -- > 2.47.3 > -- Rodrigo Siqueira
