mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
tty/vt: Return EBUSY if deallocating VT1 and it is busy
Commit 421b40a628
("tty/vt: Fix vc_deallocate() lock order") changed
the behavior when deallocating VT 1. Previously if trying to
deallocate VT1 and it is busy, we would return EBUSY. The commit
changed this to return 0 (success).
This commit restores the old behavior.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7d13205581
commit
ef223fb3d1
1 changed files with 1 additions and 4 deletions
|
@ -289,13 +289,10 @@ static int vt_disallocate(unsigned int vc_num)
|
||||||
struct vc_data *vc = NULL;
|
struct vc_data *vc = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!vc_num)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
console_lock();
|
console_lock();
|
||||||
if (VT_BUSY(vc_num))
|
if (VT_BUSY(vc_num))
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
else
|
else if (vc_num)
|
||||||
vc = vc_deallocate(vc_num);
|
vc = vc_deallocate(vc_num);
|
||||||
console_unlock();
|
console_unlock();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue