diff options
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4a7374c12d9c..089d61a23952 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2123,6 +2123,7 @@ static inline void flush_unauthorized_files(struct files_struct *files) | |||
2123 | 2123 | ||
2124 | mutex_lock(&tty_mutex); | 2124 | mutex_lock(&tty_mutex); |
2125 | tty = get_current_tty(); | 2125 | tty = get_current_tty(); |
2126 | mutex_unlock(&tty_mutex); | ||
2126 | if (tty) { | 2127 | if (tty) { |
2127 | file_list_lock(); | 2128 | file_list_lock(); |
2128 | file = list_entry(tty->tty_files.next, typeof(*file), f_u.fu_list); | 2129 | file = list_entry(tty->tty_files.next, typeof(*file), f_u.fu_list); |
@@ -2139,8 +2140,8 @@ static inline void flush_unauthorized_files(struct files_struct *files) | |||
2139 | } | 2140 | } |
2140 | } | 2141 | } |
2141 | file_list_unlock(); | 2142 | file_list_unlock(); |
2143 | tty_kref_put(tty); | ||
2142 | } | 2144 | } |
2143 | mutex_unlock(&tty_mutex); | ||
2144 | /* Reset controlling tty. */ | 2145 | /* Reset controlling tty. */ |
2145 | if (drop_tty) | 2146 | if (drop_tty) |
2146 | no_tty(); | 2147 | no_tty(); |