Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da0ccd3e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "rng: lock global variable before accessing."

parents 24d6d1dd 64f0f97c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -346,8 +346,12 @@ static int hwrng_fillfn(void *unused)
	long rc;

	while (!kthread_should_stop()) {
		if (!current_rng)
		mutex_lock(&rng_mutex);
		if (!current_rng) {
			mutex_unlock(&rng_mutex);
			break;
		}
		mutex_unlock(&rng_mutex);
		rc = rng_get_data(current_rng, rng_fillbuf,
				  rng_buffer_size(), 1);
		if (rc <= 0) {