aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
authorMohammed EL Kadiri <med08elkadiri@gmail.com>2026-06-15 15:11:50 +0300
committerJarkko Sakkinen <jarkko@kernel.org>2026-06-15 15:19:13 +0300
commit1b9524250996b1f2f49833a1b2ae21c34e486f85 (patch)
treeed7fdc6cf932ec2f13e1e26ff5d73e11b19d1fe8 /security
parent10366fe27a4ce08a392eb16ed48ea0a440e671c2 (diff)
downloadath-1b9524250996b1f2f49833a1b2ae21c34e486f85.tar.gz
keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP
Replace two BUG() calls in keyctl_pkey_params_get_2() and keyctl_pkey_e_d_s() default cases with -EOPNOTSUPP, matching the error style already used in these functions. Signed-off-by: Mohammed EL Kadiri <med08elkadiri@gmail.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/keyctl_pkey.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c
index ba150ee2d4a37..15b6bf6399b59 100644
--- a/security/keys/keyctl_pkey.c
+++ b/security/keys/keyctl_pkey.c
@@ -163,7 +163,7 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par
params->out_len = info.max_sig_size;
break;
default:
- BUG();
+ return -EOPNOTSUPP;
}
params->in_len = uparams.in_len;
@@ -245,7 +245,8 @@ long keyctl_pkey_e_d_s(int op,
params.op = kernel_pkey_sign;
break;
default:
- BUG();
+ ret = -EOPNOTSUPP;
+ goto error_params;
}
in = memdup_user(_in, params.in_len);