Commit 81f53028 authored by Tim Gardner's avatar Tim Gardner Committed by Herbert Xu

crypto: drbg - Fix unused value warning in drbg_healthcheck_sanity()

Coverity warns uf an unused value:

CID 44865 (#2 of 2): Unused value (UNUSED_VALUE)
assigned_value: Assigning value -14 to ret here, but that stored value is
overwritten before it can be used.
2006        int ret = -EFAULT;
...
value_overwrite: Overwriting previous write to ret with value from drbg_seed(drbg, &addtl, false).
2052        ret = drbg_seed(drbg, &addtl, false);

Fix this by removing the variable initializer.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 5e91f56a
...@@ -2003,7 +2003,7 @@ static inline int __init drbg_healthcheck_sanity(void) ...@@ -2003,7 +2003,7 @@ static inline int __init drbg_healthcheck_sanity(void)
#define OUTBUFLEN 16 #define OUTBUFLEN 16
unsigned char buf[OUTBUFLEN]; unsigned char buf[OUTBUFLEN];
struct drbg_state *drbg = NULL; struct drbg_state *drbg = NULL;
int ret = -EFAULT; int ret;
int rc = -EFAULT; int rc = -EFAULT;
bool pr = false; bool pr = false;
int coreref = 0; int coreref = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment