qcacld-3.0: Reject interface up request during removal of driver

During the driver unload driver de-registers the netdevices taking
hdd_init_deinit_lock and if any userspace entity trying issues the
interface taking the rtnl_lock resulting in the deadlock as one
thread is waiting for the rtnl_lock to be released taking the
hdd_init_deinit_lock and other thread is waiting for hdd_init_deinit_lock
taking the rtnl_lock. Since the driver is unloading reject the
interface up request before acquiring the hdd_init_deinit_lock.

To address this issue do not proceed with hdd_open if unload is in
progress.

CRs-Fixed: 2078720
Change-Id: Ie8c8bba8d142312d3504c40a839343e16fc3b31e
This commit is contained in:
Ashish Kumar Dhanotiya 2017-08-03 10:27:34 +05:30 • committed by Anjaneedevi Kapparapu
commit 15a7db51d2

View file

@ -2403,6 +2403,12 @@ static int __hdd_open(struct net_device *dev)
MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_OPEN_REQUEST,
adapter->sessionId, adapter->device_mode));
/* Nothing to be done if device is unloading */
if (cds_is_driver_unloading()) {
hdd_err("Driver is unloading can not open the hdd");
return -EBUSY;
}
ret = wlan_hdd_validate_context(hdd_ctx);
if (ret)
return ret;