mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
crypto: qcom-rng - Allow zero as a random number
Zero is a valid random number and needs to be allowed. Otherwise the
output is distinguishable from random.
Fixes: f29cd5bb64 ("crypto: qcom-rng - Add hw_random interface support")
Cc: stable@vger.kernel.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
0fd97bbda2
commit
4ef04bdc0c
|
|
@ -65,8 +65,6 @@ static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max)
|
|||
return ret;
|
||||
|
||||
val = readl_relaxed(rng->base + PRNG_DATA_OUT);
|
||||
if (!val)
|
||||
return -EINVAL;
|
||||
|
||||
if ((max - currsize) >= WORD_SZ) {
|
||||
memcpy(data, &val, WORD_SZ);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user