From: Ross Lagerwall Date: Fri, 14 Jun 2013 22:24:25 +0000 (+0100) Subject: tty/vt: Return EBUSY if deallocating VT1 and it is busy X-Git-Tag: upstream/snapshot3+hdmi~4889^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef223fb3d1d61c2a95a89cdc02f8e86dac96ddc3;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Tested-by: Mikael Pettersson Acked-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c index fc2c06c..2bd78e2 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) 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();