Commit 5c37dcbe authored by Stefan Richter's avatar Stefan Richter

ieee1394: lock smaller region by host_num_alloc mutex

We need the mutex only around the iteration over existing hosts.
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent b63d4fe9
...@@ -157,10 +157,9 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, ...@@ -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); h->speed_map = (u8 *)(h->csr.speed_map + 2);
mutex_lock(&host_num_alloc); mutex_lock(&host_num_alloc);
while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb)) while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
hostnum++; hostnum++;
mutex_unlock(&host_num_alloc);
h->id = hostnum; h->id = hostnum;
memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device)); 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, ...@@ -175,8 +174,6 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
class_device_register(&h->class_dev); class_device_register(&h->class_dev);
get_device(&h->device); get_device(&h->device);
mutex_unlock(&host_num_alloc);
return h; return h;
} }
......
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