mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
hwrng: amd - report partial reads in non-blocking mode
amd_rng_read() returns 0 if no more data is available, even if some data
was already copied to the output buffer. Return the number of copied
bytes instead.
Fixes: 85962d2248 ("hwrng: amd - Convert to new hwrng read() API")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <blum@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
10016246d5
commit
e7f5ce911e
|
|
@ -80,7 +80,7 @@ static int amd_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
|
|||
if (timeout-- == 0)
|
||||
return read;
|
||||
} else {
|
||||
return 0;
|
||||
return read;
|
||||
}
|
||||
} else {
|
||||
*data = ioread32(priv->iobase + RNGDATA);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user