hwrng: amd - report partial reads in non-blocking mode
Subsystems (2)
PATCH 1/1 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 85962d2248fa ("hwrng: amd - Convert to new hwrng read() API")
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/char/hw_random/amd-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hw_random/amd-rng.c +1 -1
@@ -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 );
Herbert Xu
maintainerQuoted 10 lines · Thorsten Blum
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 85962d2248fa ("hwrng: amd - Convert to new hwrng read() API")Signed-off-by Thorsten Blum <[email protected]>--- drivers/char/hw_random/amd-rng.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