Skip to contentSkip to conversation

drm/amd/display: fix memory leak when using debugfs_lookup()

PATCH In review Greg Kroah-Hartman 2 participants 6 messages Sep 2, 2022 – Sep 6, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: fix memory leak when using debugfs_lookup()

When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput().

Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Wayne Lin <[email protected]>
Cc hersen wu <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Thelford Williams <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Yongzhi Liu <[email protected]>
Cc Mikita Lipski <[email protected]>
Cc Jiapeng Chong <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Sean Paul <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +1 -0
index 0e48824f55e3..ee242d9d8b06 100644
@@ -3288,6 +3288,7 @@ void crtc_debugfs_init(struct drm_crtc *crtc)
 				   &crc_win_y_end_fops);
 	debugfs_create_file_unsafe("crc_win_update", 0644, dir, crtc,
 				   &crc_win_update_fops);
+	dput(dir);
 #endif
 	debugfs_create_file("amdgpu_current_bpc", 0644, crtc->debugfs_entry,
 			    crtc, &amdgpu_current_bpc_fops);
Signature · 1 line
2.37.3
#1 lore raw
Quoted 26 lines · Greg Kroah-Hartman

When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput().

Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Wayne Lin <[email protected]>
Cc hersen wu <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Thelford Williams <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Yongzhi Liu <[email protected]>
Cc Mikita Lipski <[email protected]>
Cc Jiapeng Chong <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 1 line

---

Despite a zillion cc: items, I forgot to cc: stable on this. Can the maintainer add that here, or do you all want me to resend it with that item added?

thanks,

greg k-h

#2 lore raw
Quoted 29 lines · Greg Kroah-Hartman
Quoted 26 lines · Greg Kroah-Hartman

When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput().

Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Wayne Lin <[email protected]>
Cc hersen wu <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Thelford Williams <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Yongzhi Liu <[email protected]>
Cc Mikita Lipski <[email protected]>
Cc Jiapeng Chong <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 1 line

---

Quoted 7 lines

Despite a zillion cc: items, I forgot to cc: stable on this. Can the maintainer add that here, or do you all want me to resend it with that item added?

thanks,

greg k-h

Hi Greg,

Is 'Cc: [email protected]' enough here? I can make this change before I merge it into amd-staging-drm-next.

Thanks
Siqueira

#3 lore raw
Quoted 38 lines · Rodrigo Siqueira Jordao
Quoted 35 lines · Greg Kroah-Hartman
Quoted 26 lines · Greg Kroah-Hartman

When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput().

Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Wayne Lin <[email protected]>
Cc hersen wu <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Thelford Williams <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Yongzhi Liu <[email protected]>
Cc Mikita Lipski <[email protected]>
Cc Jiapeng Chong <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 1 line

---

Despite a zillion cc: items, I forgot to cc: stable on this. Can the maintainer add that here, or do you all want me to resend it with that item added?

thanks,

Quoted 8 lines
Quoted 1 line

greg k-h

Hi Greg,

Is 'Cc: [email protected]' enough here? I can make this change before I merge it into amd-staging-drm-next.

Yes, please add the cc: stable@ line to the body of the patch, sorry I forgot that.

thanks,

greg k-h

#4 lore raw
Quoted 43 lines · Greg Kroah-Hartman
Quoted 42 lines · Rodrigo Siqueira Jordao
Quoted 29 lines · Greg Kroah-Hartman
Quoted 26 lines · Greg Kroah-Hartman

When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput().

Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Wayne Lin <[email protected]>
Cc hersen wu <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Thelford Williams <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Yongzhi Liu <[email protected]>
Cc Mikita Lipski <[email protected]>
Cc Jiapeng Chong <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 1 line

---

Quoted 7 lines

Despite a zillion cc: items, I forgot to cc: stable on this. Can the maintainer add that here, or do you all want me to resend it with that item added?

thanks,

greg k-h

Hi Greg,

Quoted 8 lines
Quoted 4 lines

Is 'Cc: [email protected]' enough here? I can make this change before I merge it into amd-staging-drm-next.

Yes, please add the cc: stable@ line to the body of the patch, sorry I forgot that.

Change applied to amd-staging-drm-next, with the Cc to the stable branch.

Thanks
Siqueira

Quoted 3 lines

thanks,

greg k-h

#5 lore raw
Quoted 48 lines · Rodrigo Siqueira Jordao
Quoted 45 lines · Greg Kroah-Hartman
Quoted 44 lines · Rodrigo Siqueira Jordao
Quoted 29 lines · Greg Kroah-Hartman
Quoted 26 lines · Greg Kroah-Hartman

When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. Fix this up by properly calling dput().

Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Wayne Lin <[email protected]>
Cc hersen wu <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Thelford Williams <[email protected]>
Cc Fangzhi Zuo <[email protected]>
Cc Yongzhi Liu <[email protected]>
Cc Mikita Lipski <[email protected]>
Cc Jiapeng Chong <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 1 line

---

Quoted 7 lines

Despite a zillion cc: items, I forgot to cc: stable on this. Can the maintainer add that here, or do you all want me to resend it with that item added?

thanks,

greg k-h

Hi Greg,

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Is 'Cc: [email protected]' enough here? I can make this change before I merge it into amd-staging-drm-next.

Yes, please add the cc: stable@ line to the body of the patch, sorry I forgot that.

Change applied to amd-staging-drm-next, with the Cc to the stable branch.

Wonderful, thanks!