summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/hosts.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-10-10 21:11:43 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-12-07 21:29:21 +0100
commit5c37dcbe138ed3239c5e8b6c2626ce773a7cea2e (patch)
tree0b5323eaee9c2a6e6e0e0722448fce48edabc785 /drivers/ieee1394/hosts.c
parentb63d4fe95f29b6cadffcee8cdabd8435e8560cde (diff)
downloadlinux-5c37dcbe138ed3239c5e8b6c2626ce773a7cea2e.tar.bz2
ieee1394: lock smaller region by host_num_alloc mutex
We need the mutex only around the iteration over existing hosts. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/hosts.c')
-rw-r--r--drivers/ieee1394/hosts.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
index b935e08695a9..25573bad81e0 100644
--- a/drivers/ieee1394/hosts.c
+++ b/drivers/ieee1394/hosts.c
@@ -157,10 +157,9 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
h->speed_map = (u8 *)(h->csr.speed_map + 2);
mutex_lock(&host_num_alloc);
-
while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
hostnum++;
-
+ mutex_unlock(&host_num_alloc);
h->id = hostnum;
memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device));
@@ -175,8 +174,6 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
class_device_register(&h->class_dev);
get_device(&h->device);
- mutex_unlock(&host_num_alloc);
-
return h;
}