drm/nouveau/kms/nvd9-: Fix file release memory leak
Subsystems (4)
PATCH 1/1 drm/nouveau/kms/nvd9-: Fix file release memory leak
When using single_open() for opening, single_release() should be used instead of seq_release(), otherwise there is a memory leak.
Fixes 12885ecbfe62 ("drm/nouveau/kms/nvd9-: Add CRC support")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/gpu/drm/nouveau/dispnv50/crc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/dispnv50/crc.c +1 -0
@@ -706,6 +706,7 @@ static const struct file_operations nv50_crc_flip_threshold_fops = { .open = nv50_crc_debugfs_flip_threshold_open, .read = seq_read, .write = nv50_crc_debugfs_flip_threshold_set, + .release = single_release, };int nv50_head_crc_late_register (struct nv50_head *head)
Reviewed-by Lyude Paul <[email protected]>
Thanks!
Quoted 27 lines · Wei Yongjun
When using
single_open()for opening,single_release()should be used instead ofseq_release(), otherwise there is a memory leak.Fixes 12885ecbfe62 ("drm/nouveau/kms/nvd9-: Add CRC support")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>--- drivers/gpu/drm/nouveau/dispnv50/crc.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/nouveau/dispnv50/crc.c +1
-0@@ -706,6 +706,7 @@ static const struct file_operations nv50_crc_flip_threshold_fops = { .open = nv50_crc_debugfs_flip_threshold_open, .read = seq_read, .write = nv50_crc_debugfs_flip_threshold_set, + .release = single_release, };int
nv50_head_crc_late_register(struct nv50_head *head)
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat