mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
iwlwifi: Add missing check for alloc_ordered_workqueue
Add check for the return value of alloc_ordered_workqueue since it may
return NULL pointer.
Fixes: b481de9ca0
("[IWLWIFI]: add iwlwifi wireless drivers")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://patch.msgid.link/20230110014848.28226-1-jiasheng@iscas.ac.cn
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
This commit is contained in:
parent
ed2e916c89
commit
90a0d9f339
1 changed files with 9 additions and 2 deletions
|
@ -1048,9 +1048,11 @@ static void iwl_bg_restart(struct work_struct *data)
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
static void iwl_setup_deferred_work(struct iwl_priv *priv)
|
static int iwl_setup_deferred_work(struct iwl_priv *priv)
|
||||||
{
|
{
|
||||||
priv->workqueue = alloc_ordered_workqueue(DRV_NAME, 0);
|
priv->workqueue = alloc_ordered_workqueue(DRV_NAME, 0);
|
||||||
|
if (!priv->workqueue)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
INIT_WORK(&priv->restart, iwl_bg_restart);
|
INIT_WORK(&priv->restart, iwl_bg_restart);
|
||||||
INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
|
INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
|
||||||
|
@ -1067,6 +1069,8 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
|
||||||
timer_setup(&priv->statistics_periodic, iwl_bg_statistics_periodic, 0);
|
timer_setup(&priv->statistics_periodic, iwl_bg_statistics_periodic, 0);
|
||||||
|
|
||||||
timer_setup(&priv->ucode_trace, iwl_bg_ucode_trace, 0);
|
timer_setup(&priv->ucode_trace, iwl_bg_ucode_trace, 0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void iwl_cancel_deferred_work(struct iwl_priv *priv)
|
void iwl_cancel_deferred_work(struct iwl_priv *priv)
|
||||||
|
@ -1461,7 +1465,9 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
|
||||||
/********************
|
/********************
|
||||||
* 6. Setup services
|
* 6. Setup services
|
||||||
********************/
|
********************/
|
||||||
iwl_setup_deferred_work(priv);
|
if (iwl_setup_deferred_work(priv))
|
||||||
|
goto out_uninit_drv;
|
||||||
|
|
||||||
iwl_setup_rx_handlers(priv);
|
iwl_setup_rx_handlers(priv);
|
||||||
|
|
||||||
iwl_power_initialize(priv);
|
iwl_power_initialize(priv);
|
||||||
|
@ -1500,6 +1506,7 @@ out_destroy_workqueue:
|
||||||
iwl_cancel_deferred_work(priv);
|
iwl_cancel_deferred_work(priv);
|
||||||
destroy_workqueue(priv->workqueue);
|
destroy_workqueue(priv->workqueue);
|
||||||
priv->workqueue = NULL;
|
priv->workqueue = NULL;
|
||||||
|
out_uninit_drv:
|
||||||
iwl_uninit_drv(priv);
|
iwl_uninit_drv(priv);
|
||||||
out_free_eeprom_blob:
|
out_free_eeprom_blob:
|
||||||
kfree(priv->eeprom_blob);
|
kfree(priv->eeprom_blob);
|
||||||
|
|
Loading…
Add table
Reference in a new issue