Message ID | 20210430232754.3017358-1-andrew.zaborowski@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [RESEND,1/2] keys: crypto: Replace BUG_ON() with WARN() in find_asymmetric_key() | expand |
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c index ad8af3d70ac..a00bed3e04d 100644 --- a/crypto/asymmetric_keys/asymmetric_type.c +++ b/crypto/asymmetric_keys/asymmetric_type.c @@ -54,7 +54,10 @@ struct key *find_asymmetric_key(struct key *keyring, char *req, *p; int len; - BUG_ON(!id_0 && !id_1); + if (!id_0 && !id_1) { + WARN(1, "All ID's are NULL\n"); + return ERR_PTR(-EINVAL); + } if (id_0) { lookup = id_0->data;