Skip to content

Commit

Permalink
iwlwifi: fix kernel oops when ucode DMA memory allocation failure
Browse files Browse the repository at this point in the history
The patch fixes memcpy to NULL address when the ucode DMA allocation failure.

This is a fix to bug
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1861

Signed-off-by: Zhu Yi <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
Zhu, Yi authored and linvjw committed Jan 29, 2009
1 parent eb83bbf commit 1f304e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,10 @@ static int iwl_read_ucode(struct iwl_priv *priv)
priv->ucode_data_backup.len = data_size;
iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup);

if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr ||
!priv->ucode_data_backup.v_addr)
goto err_pci_alloc;

/* Initialization instructions and data */
if (init_size && init_data_size) {
priv->ucode_init.len = init_size;
Expand Down

0 comments on commit 1f304e4

Please sign in to comment.