Skip to contentSkip to conversation

drm/nouveau: add missing single_release()

PATCH In review Wei Yongjun 2 participants 2 messages Sep 4, 2019 – Sep 5, 2019

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

PATCH 1/1 drm/nouveau: add missing single_release()

When using single_open() for opening, single_release() should be used, otherwise there is a memory leak.

This is detected by Coccinelle semantic patch.

Fixes 6e9fc177399f ("drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs")
---
 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_debugfs.c +1 -0
index 7dfbbbc1beea..35695f493271 100644
@@ -202,6 +202,7 @@ static const struct file_operations nouveau_pstate_fops = {
 	.open = nouveau_debugfs_pstate_open,
 	.read = seq_read,
 	.write = nouveau_debugfs_pstate_set,
+	.release = single_release,
 };
 
 static struct drm_info_list nouveau_debugfs_list[] = {
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Wei Yongjun

When using single_open() for opening, single_release() should be used, otherwise there is a memory leak.

This is detected by Coccinelle semantic patch.

Fixes 6e9fc177399f ("drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs")
---
 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_debugfs.c +1 -0
index 7dfbbbc1beea..35695f493271 100644
@@ -202,6 +202,7 @@ static const struct file_operations nouveau_pstate_fops = {
        .open = nouveau_debugfs_pstate_open,
        .read = seq_read,
        .write = nouveau_debugfs_pstate_set,
+       .release = single_release,
 };
 
 static struct drm_info_list nouveau_debugfs_list[] = {
Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau