Commit 99b38a19 authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] InfiniBand/mthca: initialize mutex earlier

The cap_mask_mutex needs to be initialized before ib_register_device(),
because device registration will call client init functions that may try to
modify the capability mask.
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a99814b6
...@@ -634,6 +634,8 @@ int mthca_register_device(struct mthca_dev *dev) ...@@ -634,6 +634,8 @@ int mthca_register_device(struct mthca_dev *dev)
dev->ib_dev.detach_mcast = mthca_multicast_detach; dev->ib_dev.detach_mcast = mthca_multicast_detach;
dev->ib_dev.process_mad = mthca_process_mad; dev->ib_dev.process_mad = mthca_process_mad;
init_MUTEX(&dev->cap_mask_mutex);
ret = ib_register_device(&dev->ib_dev); ret = ib_register_device(&dev->ib_dev);
if (ret) if (ret)
return ret; return ret;
...@@ -647,8 +649,6 @@ int mthca_register_device(struct mthca_dev *dev) ...@@ -647,8 +649,6 @@ int mthca_register_device(struct mthca_dev *dev)
} }
} }
init_MUTEX(&dev->cap_mask_mutex);
return 0; return 0;
} }
......
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