diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c index 220c2cf7bd42..45d5c5926d03 100644 --- a/security/keys/encrypted-keys/encrypted.c +++ b/security/keys/encrypted-keys/encrypted.c @@ -847,7 +847,7 @@ static int encrypted_update(struct key *key, struct key_preparsed_payload *prep) if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) return -ENOKEY; - if (datalen <= 0 || datalen > 32767 || !data) + if (datalen <= 0 || datalen > 32767 || !prep->data) return -EINVAL; buf = kmalloc(datalen + 1, GFP_KERNEL);