Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / security / keys / request_key.c
index 0d26f68..0088dd8 100644 (file)
@@ -537,6 +537,8 @@ int wait_for_key_construction(struct key *key, bool intr)
                          intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
        if (ret < 0)
                return ret;
+       if (test_bit(KEY_FLAG_NEGATIVE, &key->flags))
+               return -ENOKEY;
        return key_validate(key);
 }
 EXPORT_SYMBOL(wait_for_key_construction);