Skip to content

Commit

Permalink
ath10k: fix null deref if device crashes early
Browse files Browse the repository at this point in the history
If device failed to init during early probing
(which is quite rare) it triggered driver to
compute crc before ar->firmware was ready causing
an oops.

Fixes: 3e58044 ("ath10k: print crc32 checksums for firmware and board files")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Michal Kazior authored and Kalle Valo committed Mar 21, 2016
1 parent 750eeed commit 8866c72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/ath/ath10k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ EXPORT_SYMBOL(ath10k_info);
void ath10k_debug_print_hwfw_info(struct ath10k *ar)
{
char fw_features[128] = {};
u32 crc = 0;

ath10k_core_get_fw_features_str(ar, fw_features, sizeof(fw_features));

Expand All @@ -143,11 +144,14 @@ void ath10k_debug_print_hwfw_info(struct ath10k *ar)
config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
config_enabled(CONFIG_NL80211_TESTMODE));

if (ar->firmware)
crc = crc32_le(0, ar->firmware->data, ar->firmware->size);

ath10k_info(ar, "firmware ver %s api %d features %s crc32 %08x\n",
ar->hw->wiphy->fw_version,
ar->fw_api,
fw_features,
crc32_le(0, ar->firmware->data, ar->firmware->size));
crc);
}

void ath10k_debug_print_board_info(struct ath10k *ar)
Expand Down

0 comments on commit 8866c72

Please sign in to comment.