mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-24 18:38:38 +00:00
hwrng: core - Simplify RNG switching from sysfs
If we attempt to use sysfs to change the current RNG in the usual way i.e. issuing something like: `echo 8a8a000.rng > /sys/devices/virtual/misc/hw_random/rng_current` ... it will fail because the code doesn't currently take the '\n' into consideration. Well, now it does. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
cb2c316b22
commit
d9a53b0140
@ -323,7 +323,7 @@ static ssize_t hwrng_attr_current_store(struct device *dev,
|
||||
return -ERESTARTSYS;
|
||||
err = -ENODEV;
|
||||
list_for_each_entry(rng, &rng_list, list) {
|
||||
if (strcmp(rng->name, buf) == 0) {
|
||||
if (sysfs_streq(rng->name, buf)) {
|
||||
err = 0;
|
||||
if (rng != current_rng)
|
||||
err = set_current_rng(rng);
|
||||
|
Loading…
Reference in New Issue
Block a user