From: Andrey Vagin Date: Mon, 9 Jul 2012 17:31:06 +0000 (-0700) Subject: net: wireless: bcm4329: Init locks in dhd_attach() at the beginning X-Git-Tag: firefly_0821_release~7613^2~80 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f70624b6e536e99feeb793f1417375cce953966d;p=firefly-linux-kernel-4.4.55.git net: wireless: bcm4329: Init locks in dhd_attach() at the beginning Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c index 5f5b418abc26..b466d745f848 100644 --- a/drivers/net/wireless/bcm4329/dhd_linux.c +++ b/drivers/net/wireless/bcm4329/dhd_linux.c @@ -2086,6 +2086,17 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen) memcpy(netdev_priv(net), &dhd, sizeof(dhd)); dhd->pub.osh = osh; + mutex_init(&dhd->proto_sem); + mutex_init(&dhd->sdsem); + /* Initialize other structure content */ + init_waitqueue_head(&dhd->ioctl_resp_wait); + init_waitqueue_head(&dhd->ctrl_wait); + + /* Initialize the spinlocks */ + spin_lock_init(&dhd->sdlock); + spin_lock_init(&dhd->txqlock); + spin_lock_init(&dhd->dhd_lock); + /* Set network interface name if it was provided as module parameter */ if (iface_name[0]) { int len; @@ -2107,16 +2118,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen) net->netdev_ops = NULL; #endif - mutex_init(&dhd->proto_sem); - /* Initialize other structure content */ - init_waitqueue_head(&dhd->ioctl_resp_wait); - init_waitqueue_head(&dhd->ctrl_wait); - - /* Initialize the spinlocks */ - spin_lock_init(&dhd->sdlock); - spin_lock_init(&dhd->txqlock); - spin_lock_init(&dhd->dhd_lock); - /* Initialize Wakelock stuff */ spin_lock_init(&dhd->wl_lock); dhd->wl_count = 0; @@ -2154,7 +2155,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen) dhd->timer.function = dhd_watchdog; /* Initialize thread based operation and lock */ - mutex_init(&dhd->sdsem); if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)) { dhd->threads_only = TRUE; }