mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
qcacld-3.0: Add check to Validate hif_ctx
Currently hif_ctx is passed as a parameter in hif_get_hw_info and hif_bus_reset_resume without any validation check for the parameter. This change Validates hif_ctx before dereferencing the hif_ctx. Change-Id: I17636692863bfdded691594cef40ebe55e262849 CRs-Fixed: 1066838
This commit is contained in:
parent
feedebab05
commit
ce6a405adf
2 changed files with 16 additions and 4 deletions
|
|
@ -800,9 +800,16 @@ int wlan_hdd_bus_resume_noirq(void)
|
|||
static int wlan_hdd_bus_reset_resume(void)
|
||||
{
|
||||
int ret;
|
||||
struct hif_opaque_softc *scn = NULL;
|
||||
|
||||
scn = cds_get_context(QDF_MODULE_ID_HIF);
|
||||
if (!scn) {
|
||||
hdd_err("Failed to get HIF context");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
cds_ssr_protect(__func__);
|
||||
ret = hif_bus_reset_resume(cds_get_context(QDF_MODULE_ID_HIF));
|
||||
ret = hif_bus_reset_resume(scn);
|
||||
cds_ssr_unprotect(__func__);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7634,6 +7634,10 @@ int hdd_wlan_startup(struct device *dev)
|
|||
}
|
||||
|
||||
hif_sc = cds_get_context(QDF_MODULE_ID_HIF);
|
||||
if (!hif_sc) {
|
||||
hdd_err("HIF context is NULL");
|
||||
goto err_close_adapter;
|
||||
}
|
||||
/*
|
||||
* target hw version/revision would only be retrieved after firmware
|
||||
* donwload
|
||||
|
|
@ -7704,19 +7708,20 @@ int hdd_wlan_startup(struct device *dev)
|
|||
|
||||
err_debugfs_exit:
|
||||
hdd_debugfs_exit(adapter);
|
||||
|
||||
err_close_adapter:
|
||||
hdd_close_all_adapters(hdd_ctx, false);
|
||||
|
||||
if (rtnl_held)
|
||||
hdd_release_rtnl_lock();
|
||||
|
||||
err_ipa_cleanup:
|
||||
hdd_ipa_cleanup(hdd_ctx);
|
||||
|
||||
err_wiphy_unregister:
|
||||
wiphy_unregister(hdd_ctx->wiphy);
|
||||
wlan_hdd_cfg80211_deinit(hdd_ctx->wiphy);
|
||||
|
||||
err_ipa_cleanup:
|
||||
hdd_ipa_cleanup(hdd_ctx);
|
||||
|
||||
err_stop_modules:
|
||||
hdd_wlan_stop_modules(hdd_ctx, false);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue