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

Commit af8c7237 authored by David Fries's avatar David Fries Committed by Greg Kroah-Hartman
Browse files

w1: Only wake up the search process if it is going to be searching



It's valid to set the search count to 0 to stop searching, so don't
wake up the search thread to not search.

Signed-off-by: default avatarDavid Fries <David@Fries.net>
Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 42105698
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ static ssize_t w1_master_attribute_store_search(struct device * dev,
	mutex_lock(&md->mutex);
	md->search_count = tmp;
	mutex_unlock(&md->mutex);
	/* Only wake if it is going to be searching. */
	if (tmp)
		wake_up_process(md->thread);

	return count;