From ced6a58638432c9f731184f908208d539725ba82 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 5 Nov 2017 18:30:48 -0800 Subject: crypto: dh - Remove pointless checks for NULL 'p' and 'g' Neither 'p' nor 'g' can be NULL, as they were unpacked using crypto_dh_decode_key(). And it makes no sense for them to be optional. So remove the NULL checks that were copy-and-pasted into both modules. Signed-off-by: Eric Biggers Reviewed-by: Tudor Ambarus Signed-off-by: Herbert Xu --- crypto/dh.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'crypto') diff --git a/crypto/dh.c b/crypto/dh.c index aadaf36..5659fe7 100644 --- a/crypto/dh.c +++ b/crypto/dh.c @@ -53,9 +53,6 @@ static int dh_check_params_length(unsigned int p_len) static int dh_set_params(struct dh_ctx *ctx, struct dh *params) { - if (unlikely(!params->p || !params->g)) - return -EINVAL; - if (dh_check_params_length(params->p_size << 3)) return -EINVAL; -- cgit v1.1