summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorBart Westgeest2012-01-25 19:46:32 +0100
committerGreg Kroah-Hartman2012-02-08 23:14:15 +0100
commit737912e11bf5bd4874acc771d8511a6eab891fc5 (patch)
treed5af155fa17a25e2ce253e32c47c13408e739fe0 /drivers/staging
parentstaging: r8712u: Fix problem when CONFIG_R8712_AP is set (diff)
downloadkernel-qcow2-linux-737912e11bf5bd4874acc771d8511a6eab891fc5.tar.gz
kernel-qcow2-linux-737912e11bf5bd4874acc771d8511a6eab891fc5.tar.xz
kernel-qcow2-linux-737912e11bf5bd4874acc771d8511a6eab891fc5.zip
staging: usbip: fix to prevent potentially using uninitialized spinlock
The stub_probe function can be called as soon as the stub_driver is registered. This can lead to the busid_table_lock being used before it is initialized. Moved calling the init_busid_table function (which initalizes this spinlock) to be called earlier in the init function to prevent this from happening. Signed-off-by: Bart Westgeest <bart@elbrys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/usbip/stub_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c
index 2d6317850064..705a9e530a19 100644
--- a/drivers/staging/usbip/stub_main.c
+++ b/drivers/staging/usbip/stub_main.c
@@ -246,8 +246,9 @@ static int __init usbip_host_init(void)
{
int ret;
- stub_priv_cache = KMEM_CACHE(stub_priv, SLAB_HWCACHE_ALIGN);
+ init_busid_table();
+ stub_priv_cache = KMEM_CACHE(stub_priv, SLAB_HWCACHE_ALIGN);
if (!stub_priv_cache) {
pr_err("kmem_cache_create failed\n");
return -ENOMEM;
@@ -266,7 +267,6 @@ static int __init usbip_host_init(void)
goto err_create_file;
}
- init_busid_table();
pr_info(DRIVER_DESC " v" USBIP_VERSION "\n");
return ret;