Commit f5908267 authored by Herbert Xu's avatar Herbert Xu

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 55639353
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment