Skip to content

Commit

Permalink
crypto: drbg - Fix unused value warning in drbg_healthcheck_sanity()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
rtg-canonical authored and herbertx committed Sep 17, 2021
1 parent 5e91f56 commit 81f5302
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ static inline int __init drbg_healthcheck_sanity(void)
#define OUTBUFLEN 16
unsigned char buf[OUTBUFLEN];
struct drbg_state *drbg = NULL;
int ret = -EFAULT;
int ret;
int rc = -EFAULT;
bool pr = false;
int coreref = 0;
Expand Down

0 comments on commit 81f5302

Please sign in to comment.