aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorDavid Fries <david@fries.net>2008-10-16 01:04:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:49 -0400
commit0d671b272af9eb06260ab3fd210d454e98dd4216 (patch)
tree9a50a3ebb351ff869ce1ba71333b59fa4fc17f48 /drivers/w1
parentc30c9b15187e977ab5928f7276e9dfcd8d6f9460 (diff)
W1: abort search early on on exit
Early abort if the master driver or the hardware goes away in the middle of a bus search operation. The alternative is to spam the print buffer up to 64*64 times with read errors in the case of USB. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 25640f681729..aac03f151fe0 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -772,6 +772,11 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
772 /* extract the direction taken & update the device number */ 772 /* extract the direction taken & update the device number */
773 tmp64 = (triplet_ret >> 2); 773 tmp64 = (triplet_ret >> 2);
774 rn |= (tmp64 << i); 774 rn |= (tmp64 << i);
775
776 if (test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) {
777 printk(KERN_INFO "Abort w1_search (exiting)\n");
778 return;
779 }
775 } 780 }
776 781
777 if ( (triplet_ret & 0x03) != 0x03 ) { 782 if ( (triplet_ret & 0x03) != 0x03 ) {