Skip to content

Commit

Permalink
tty/vt: Return EBUSY if deallocating VT1 and it is busy
Browse files Browse the repository at this point in the history
Commit 421b40a ("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>
  • Loading branch information
Ross Lagerwall authored and Greg Kroah-Hartman committed Jun 17, 2013
1 parent 7d13205 commit ef223fb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/tty/vt/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,10 @@ static int vt_disallocate(unsigned int vc_num)
struct vc_data *vc = NULL;
int ret = 0;

if (!vc_num)
return 0;

console_lock();
if (VT_BUSY(vc_num))
ret = -EBUSY;
else
else if (vc_num)
vc = vc_deallocate(vc_num);
console_unlock();

Expand Down

0 comments on commit ef223fb

Please sign in to comment.