]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/dquot.c
tty: Make get_current_tty use a kref
[karo-tx-linux.git] / fs / dquot.c
index 8ec4d6cc763317bf8403a7eae3c666ef2b97b136..7417a6ca3129993b316456acd364e17a1102ee02 100644 (file)
@@ -897,8 +897,9 @@ static void print_warning(struct dquot *dquot, const int warntype)
 
        mutex_lock(&tty_mutex);
        tty = get_current_tty();
+       mutex_unlock(&tty_mutex);
        if (!tty)
-               goto out_lock;
+               return;
        tty_write_message(tty, dquot->dq_sb->s_id);
        if (warntype == QUOTA_NL_ISOFTWARN || warntype == QUOTA_NL_BSOFTWARN)
                tty_write_message(tty, ": warning, ");
@@ -926,8 +927,7 @@ static void print_warning(struct dquot *dquot, const int warntype)
                        break;
        }
        tty_write_message(tty, msg);
-out_lock:
-       mutex_unlock(&tty_mutex);
+       tty_kref_put(tty);
 }
 #endif