]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
w1: Only wake up the search process if it is going to be searching
authorDavid Fries <David@Fries.net>
Thu, 16 Jan 2014 04:29:14 +0000 (22:29 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 23:40:17 +0000 (15:40 -0800)
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: David Fries <David@Fries.net>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/w1.c

index 67b6d5fb25bc35f7d41e0e17ca4f7ad1168cf12c..92766a9f8b4d71e69314edcfd682c1edf9071f00 100644 (file)
@@ -243,7 +243,9 @@ static ssize_t w1_master_attribute_store_search(struct device * dev,
        mutex_lock(&md->mutex);
        md->search_count = tmp;
        mutex_unlock(&md->mutex);
-       wake_up_process(md->thread);
+       /* Only wake if it is going to be searching. */
+       if (tmp)
+               wake_up_process(md->thread);
 
        return count;
 }