From 071cd6268aeaaef702387dacaf4ef1ffbb7618fc Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Thu, 3 Jun 2021 10:35:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DMagicKey=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E8=B6=8A=E7=95=8C=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #I3U4N9 Signed-off-by: Guangyao Ma Change-Id: Ic4c4c7442cd381d03d2e40a51655a17299c4c250 --- kernel/common/los_magickey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/common/los_magickey.c b/kernel/common/los_magickey.c index f0361149..7e5f00ee 100644 --- a/kernel/common/los_magickey.c +++ b/kernel/common/los_magickey.c @@ -143,8 +143,8 @@ INT32 CheckMagicKey(CHAR key) } if (magicKeySwitch != 0) { - for (i = 0; g_magicOpTable[i] != NULL; ++i) { - if (key == g_magicOpTable[i]->magicKey) { + for (i = 0; i < MAGIC_KEY_NUM; i++) { + if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) { (g_magicOpTable[i])->opHandler(); return 1; }