X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=net%2Fceph%2Fcrypto.c;h=bf9d079cbafd6e89d56ef5f10d81727bd5cbd42b;hb=87fc5c686ef3db9e58d2fd65e1bcc368ee6b1b76;hp=489610ac1cddad2e284515def1bb2185f620d3aa;hpb=0be500363c6709032254cd52c8059d9ace61de73;p=mirror_ubuntu-bionic-kernel.git diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index 489610ac1cdd..bf9d079cbafd 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -37,7 +37,9 @@ static int set_secret(struct ceph_crypto_key *key, void *buf) return -ENOTSUPP; } - WARN_ON(!key->len); + if (!key->len) + return -EINVAL; + key->key = kmemdup(buf, key->len, GFP_NOIO); if (!key->key) { ret = -ENOMEM;