Commit 7841b647 authored by David Fries's avatar David Fries Committed by Greg Kroah-Hartman

Revert ds1wm.c from "w1: hold bus_mutex in netlink and search"

This reverts ds1wm.c from commit d3a8a9db.
Of the three files changed ds1wm.c ds2490.c and w1_netlink.c, it turns out
ds1wm.c was locking bus_mutex, but inside the loop and I missed it.
Reverting ds1wm.c to the previous version.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid Fries <David@Fries.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3a8a9db
......@@ -326,14 +326,13 @@ static void ds1wm_search(void *data, struct w1_master *master_dev,
unsigned slaves_found = 0;
unsigned int pass = 0;
mutex_lock(&master_dev->bus_mutex);
dev_dbg(&ds1wm_data->pdev->dev, "search begin\n");
while (true) {
++pass;
if (pass > 100) {
dev_dbg(&ds1wm_data->pdev->dev,
"too many attempts (100), search aborted\n");
break;
return;
}
mutex_lock(&master_dev->bus_mutex);
......@@ -440,7 +439,6 @@ static void ds1wm_search(void *data, struct w1_master *master_dev,
dev_dbg(&ds1wm_data->pdev->dev,
"pass: %d total: %d search done ms d bit pos: %d\n", pass,
slaves_found, ms_discrep_bit);
mutex_unlock(&master_dev->bus_mutex);
}
/* --------------------------------------------------------------------- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment