From: Stephan Mueller Date: Sun, 17 Aug 2014 15:41:38 +0000 (+0200) Subject: crypto: drbg - remove unnecessary sanity check for shadow state X-Git-Tag: v3.18-rc1~132^2~23 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=84693d87a6d7e84a5183fc871653269880614d92;p=karo-tx-linux.git crypto: drbg - remove unnecessary sanity check for shadow state During creation of the DRBG shadow state, it is ensured that the DRBG state structure is already allocated. Thus, a sanity check for verifying that the structure is allocated is removed. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu --- diff --git a/crypto/drbg.c b/crypto/drbg.c index b4938bb4c465..9fd239fea963 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1155,9 +1155,6 @@ static inline int drbg_alloc_state(struct drbg_state *drbg) int ret = -ENOMEM; unsigned int sb_size = 0; - if (!drbg) - return -EINVAL; - drbg->V = kmalloc(drbg_statelen(drbg), GFP_KERNEL); if (!drbg->V) goto err;