diff options
Diffstat (limited to 'net/ceph/crypto.c')
-rw-r--r-- | net/ceph/crypto.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index 46008d5ac504..bf9d079cbafd 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include <linux/ceph/ceph_debug.h> @@ -36,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; |