提交 0d671b27 编写于 作者: D David Fries 提交者: Linus Torvalds

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: NDavid Fries <david@fries.net>
Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c30c9b15
...@@ -772,6 +772,11 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb ...@@ -772,6 +772,11 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
/* extract the direction taken & update the device number */ /* extract the direction taken & update the device number */
tmp64 = (triplet_ret >> 2); tmp64 = (triplet_ret >> 2);
rn |= (tmp64 << i); rn |= (tmp64 << i);
if (test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) {
printk(KERN_INFO "Abort w1_search (exiting)\n");
return;
}
} }
if ( (triplet_ret & 0x03) != 0x03 ) { if ( (triplet_ret & 0x03) != 0x03 ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册