Unverified Commit 8cfcf54d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10141 vt_ioctl: fix array_index_nospec in vt_setactivate

parents 9441eee4 a5dac4d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -673,9 +673,9 @@ int vt_ioctl(struct tty_struct *tty,
		if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES)
		if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES)
			ret = -ENXIO;
			ret = -ENXIO;
		else {
		else {
			vsa.console = array_index_nospec(vsa.console,
							 MAX_NR_CONSOLES + 1);
			vsa.console--;
			vsa.console--;
			vsa.console = array_index_nospec(vsa.console,
							 MAX_NR_CONSOLES);
			console_lock();
			console_lock();
			ret = vc_allocate(vsa.console);
			ret = vc_allocate(vsa.console);
			if (ret == 0) {
			if (ret == 0) {