From: Stephan Mueller Date: Sun, 17 Aug 2014 15:40:20 +0000 (+0200) Subject: crypto: drbg - remove unnecessary sanity checks X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bc034ef5573ef4d81daa666c02a3df1ad28e24a7;p=linux-beck.git crypto: drbg - remove unnecessary sanity checks The drbg_make_shadow function contains sanity checks which are not needed as the function is invoked at times where it is ensured that the checked-for variables are available. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu --- diff --git a/crypto/drbg.c b/crypto/drbg.c index ebe0afc4e94b..701575734420 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1263,15 +1263,6 @@ static int drbg_make_shadow(struct drbg_state *drbg, struct drbg_state **shadow) int ret = -ENOMEM; struct drbg_state *tmp = NULL; - if (!drbg || !drbg->core || !drbg->V || !drbg->C) { - pr_devel("DRBG: attempt to generate shadow copy for " - "uninitialized DRBG state rejected\n"); - return -EINVAL; - } - /* HMAC does not have a scratchpad */ - if (!(drbg->core->flags & DRBG_HMAC) && NULL == drbg->scratchpad) - return -EINVAL; - tmp = kzalloc(sizeof(struct drbg_state), GFP_KERNEL); if (!tmp) return -ENOMEM;