瀏覽代碼

selftests, x86, protection_keys: fix uninitialized variable warning

'orig_pkru' might have been uninitialized here.  Fix it.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Dave Hansen 8 年之前
父節點
當前提交
16846c2d96
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/testing/selftests/x86/protection_keys.c

+ 1 - 1
tools/testing/selftests/x86/protection_keys.c

@@ -462,7 +462,7 @@ void pkey_disable_set(int pkey, int flags)
 	unsigned long syscall_flags = 0;
 	int ret;
 	int pkey_rights;
-	u32 orig_pkru;
+	u32 orig_pkru = rdpkru();
 
 	dprintf1("START->%s(%d, 0x%x)\n", __func__,
 		pkey, flags);