Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hwrng: core - only set cur_rng_set_by_user if it is working

In case the user-specified rng device is not working, it is not used;
therefore cur_rng_set_by_user must not be set to 1.

Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Dominik Brodowski and committed by
Herbert Xu
f41aa47c c05ac449

+2 -1
+2 -1
drivers/char/hw_random/core.c
··· 335 335 } else { 336 336 list_for_each_entry(rng, &rng_list, list) { 337 337 if (sysfs_streq(rng->name, buf)) { 338 - cur_rng_set_by_user = 1; 339 338 err = set_current_rng(rng); 339 + if (!err) 340 + cur_rng_set_by_user = 1; 340 341 break; 341 342 } 342 343 }