lkml.org 
[lkml]   [2019]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] i915: do not leak module ref counter
Date
put_filesystem() before i915_gemfs_init() deals with
kern_mount() error.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
drivers/gpu/drm/i915/gem/i915_gemfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gemfs.c b/drivers/gpu/drm/i915/gem/i915_gemfs.c
index cf05ba72df9d..d437188d1736 100644
--- a/drivers/gpu/drm/i915/gem/i915_gemfs.c
+++ b/drivers/gpu/drm/i915/gem/i915_gemfs.c
@@ -24,8 +24,10 @@ int i915_gemfs_init(struct drm_i915_private *i915)
return -ENODEV;

gemfs = kern_mount(type);
- if (IS_ERR(gemfs))
+ if (IS_ERR(gemfs)) {
+ put_filesystem(type);
return PTR_ERR(gemfs);
+ }

/*
* Enable huge-pages for objects that are at least HPAGE_PMD_SIZE, most
--
2.22.0
\
 
 \ /
  Last update: 2019-08-02 14:41    [W:0.089 / U:1.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site