crypto: drbg - Fix unused value warning in drbg_healthcheck_sanity()
PATCH 1/1 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.
--- crypto/drbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/drbg.c +1 -1
@@ -2003,7 +2003,7 @@ static inline int __init drbg_healthcheck_sanity(void)#define OUTBUFLEN 16unsigned char buf[OUTBUFLEN ];struct drbg_state *drbg =NULL ; -int ret = -EFAULT ; +int ret;int rc = -EFAULT ;bool pr = false;int coreref =0 ;
Signature · 1 line
2.33.0
Herbert Xu
maintainerQuoted 12 lines · Tim Gardner
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 fromdrbg_seed(drbg, &addtl, false).
2052 ret =drbg_seed(drbg, &addtl, false);Fix this by removing the variable initializer.
Quoted 8 lines
Cc Herbert Xu <[email protected]>Cc "David S. Miller" <[email protected]>Signed-off-by Tim Gardner <[email protected]>--- crypto/drbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt