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:
Herbert Xu 2009-12-23 23:22:34 +08:00
parent 55639353a0
commit f5908267b6

View File

@ -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;
}