From: David Fries Date: Thu, 16 Jan 2014 04:29:14 +0000 (-0600) Subject: w1: Only wake up the search process if it is going to be searching X-Git-Tag: next-20140306~20^2~82 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=af8c7237b082acefb996878a21a87017059b2c52;p=karo-tx-linux.git 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: David Fries Acked-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 67b6d5fb25bc..92766a9f8b4d 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -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; }