selftests, x86, protection_keys: fix uninitialized variable warning
authorDave Hansen <dave.hansen@linux.intel.com>
Fri, 3 Feb 2017 18:51:34 +0000 (10:51 -0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 8 Feb 2017 18:15:35 +0000 (11:15 -0700)
'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>
tools/testing/selftests/x86/protection_keys.c

index 46f53ec502f66447cbad88dd35f82eeee8f84c33..bccc6f2a2f7e294601c6d8baa78b034413b9b404 100644 (file)
@@ -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);