forked from luck/tmp_suning_uos_patched
hwrng: core - Fix double unlock in rng_dev_read
When the loop terminates with size == 0 in rng_dev_read we will unlock the rng mutex twice. Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
55639353a0
commit
f5908267b6
@ -158,10 +158,11 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
out_unlock:
|
||||
mutex_unlock(&rng_mutex);
|
||||
out:
|
||||
return ret ? : err;
|
||||
out_unlock:
|
||||
mutex_unlock(&rng_mutex);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user