Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d5c47f5 authored by Alexander Inyukhin's avatar Alexander Inyukhin Committed by Greg Kroah-Hartman
Browse files

USB: chaoskey read offset bug



Rng reads in chaoskey driver could return the same data under
the certain conditions.

Signed-off-by: default avatarAlexander Inyukhin <shurick@sectorb.msk.ru>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8484bf29
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static int chaoskey_rng_read(struct hwrng *rng, void *data,
	if (this_time > max)
		this_time = max;

	memcpy(data, dev->buf, this_time);
	memcpy(data, dev->buf + dev->used, this_time);

	dev->used += this_time;