[PATCHv2,2/2] i915: do not leak module ref counter
diff mbox series

Message ID 20190820031359.11717-2-sergey.senozhatsky@gmail.com
State New
Headers show
Series
  • [PATCHv2,1/2] fs: export put_filesystem()
Related show

Commit Message

Sergey Senozhatsky Aug. 20, 2019, 3:13 a.m. UTC
Always put_filesystem() in i915_gemfs_init().

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 - v2: rebased (i915 does not remount gemfs anymore)

 drivers/gpu/drm/i915/gem/i915_gemfs.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Christoph Hellwig Aug. 20, 2019, 5:56 a.m. UTC | #1
On Tue, Aug 20, 2019 at 12:13:59PM +0900, Sergey Senozhatsky wrote:
> Always put_filesystem() in i915_gemfs_init().
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> ---
>  - v2: rebased (i915 does not remount gemfs anymore)

Which means it real doesn't need its mount anyore, and thus can use
plain old shmem_file_setup and doesn't need to mess with file system
types at all.

Assuming we find a legitimate rason for why a driver should be able
to create a kernel mount or a file system type where it doesn't have
access to the struct file_system_type an API that mount by file system
name and thus hides the get_fs_type and put_filesystem would be a much
better API than adding this random export.

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gem/i915_gemfs.c b/drivers/gpu/drm/i915/gem/i915_gemfs.c
index 5e6e8c91ab38..0a398e1e45fc 100644
--- a/drivers/gpu/drm/i915/gem/i915_gemfs.c
+++ b/drivers/gpu/drm/i915/gem/i915_gemfs.c
@@ -30,6 +30,7 @@  int i915_gemfs_init(struct drm_i915_private *i915)
 	 */
 
 	gemfs = kern_mount(type);
+	put_filesystem(type);
 	if (IS_ERR(gemfs))
 		return PTR_ERR(gemfs);