diff options
| author | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-06-14 18:24:25 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 15:37:29 -0400 |
| commit | ef223fb3d1d61c2a95a89cdc02f8e86dac96ddc3 (patch) | |
| tree | af86ef5993496aa476bb0a487dcd38b7f2890ac2 | |
| parent | 7d132055814ef17a6c7b69f342244c410a5e000f (diff) | |
tty/vt: Return EBUSY if deallocating VT1 and it is busy
Commit 421b40a6286e ("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>
| -rw-r--r-- | drivers/tty/vt/vt_ioctl.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c index fc2c06c66e89..2bd78e2ac8ec 100644 --- a/drivers/tty/vt/vt_ioctl.c +++ b/drivers/tty/vt/vt_ioctl.c | |||
| @@ -289,13 +289,10 @@ static int vt_disallocate(unsigned int vc_num) | |||
| 289 | struct vc_data *vc = NULL; | 289 | struct vc_data *vc = NULL; |
| 290 | int ret = 0; | 290 | int ret = 0; |
| 291 | 291 | ||
| 292 | if (!vc_num) | ||
| 293 | return 0; | ||
| 294 | |||
| 295 | console_lock(); | 292 | console_lock(); |
| 296 | if (VT_BUSY(vc_num)) | 293 | if (VT_BUSY(vc_num)) |
| 297 | ret = -EBUSY; | 294 | ret = -EBUSY; |
| 298 | else | 295 | else if (vc_num) |
| 299 | vc = vc_deallocate(vc_num); | 296 | vc = vc_deallocate(vc_num); |
| 300 | console_unlock(); | 297 | console_unlock(); |
| 301 | 298 | ||
