Skip to content

Commit

Permalink
iwlwifi: fix possible read attempt on ucode that is not available
Browse files Browse the repository at this point in the history
This fixes a NULL pointer dereference that can occur when the
ucode is not loaded at the time __iwl_up is called.

The problem was reported at http://kerneloops.org/raw.php?rawid=2765&msgid=

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Reinette Chatre authored and David S. Miller committed Jan 23, 2008
1 parent 1e34a11 commit a781cf9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6342,6 +6342,11 @@ static int __iwl_up(struct iwl_priv *priv)
return 0;
}

if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
IWL_ERROR("ucode not available for device bringup\n");
return -EIO;
}

iwl_write32(priv, CSR_INT, 0xFFFFFFFF);

rc = iwl_hw_nic_init(priv);
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6698,6 +6698,11 @@ static int __iwl_up(struct iwl_priv *priv)
return 0;
}

if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
IWL_ERROR("ucode not available for device bringup\n");
return -EIO;
}

iwl_write32(priv, CSR_INT, 0xFFFFFFFF);

rc = iwl_hw_nic_init(priv);
Expand Down

0 comments on commit a781cf9

Please sign in to comment.