forked from Minki/linux
s390/crypto: avoid returning garbage value
Static analysis with cppcheck detected that ret is not initialized
and hence garbage is potentially being returned in the case where
prng_data->ppnows.reseed_counter <= prng_reseed_limit.
Thanks to Martin Schwidefsky for spotting a mistake in my original
fix.
Fixes: 0177db01ad
("s390/crypto: simplify return code handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
e68f1d4ca9
commit
6512391a30
@ -434,7 +434,7 @@ static int prng_sha512_generate(u8 *buf, size_t nbytes)
|
|||||||
memcpy(prng_data->prev, buf, nbytes);
|
memcpy(prng_data->prev, buf, nbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user