mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
hwrng: core - correct error check of kthread_run call
[ Upstream commit 17fb874dee093139923af8ed36061faa92cc8e79 ] The kthread_run() function can return two different error values but the hwrng core only checks for -ENOMEM. If the other error value -EINTR is returned it is assigned to hwrng_fill and later used on a kthread_stop() call which naturally crashes. Cc: stable@vger.kernel.org Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Change-Id: I4ad273645fdf8cb16f4a04d274e40330ab77bade
This commit is contained in:
parent
fda3f8e888
commit
ffe6845842
1 changed files with 1 additions and 1 deletions
|
@ -356,7 +356,7 @@ static int hwrng_fillfn(void *unused)
|
||||||
static void start_khwrngd(void)
|
static void start_khwrngd(void)
|
||||||
{
|
{
|
||||||
hwrng_fill = kthread_run(hwrng_fillfn, NULL, "hwrng");
|
hwrng_fill = kthread_run(hwrng_fillfn, NULL, "hwrng");
|
||||||
if (hwrng_fill == ERR_PTR(-ENOMEM)) {
|
if (IS_ERR(hwrng_fill)) {
|
||||||
pr_err("hwrng_fill thread creation failed");
|
pr_err("hwrng_fill thread creation failed");
|
||||||
hwrng_fill = NULL;
|
hwrng_fill = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue