linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: fix null deref if device crashes early
@ 2016-03-17  9:52 Michal Kazior
  2016-03-23 12:09 ` Valo, Kalle
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Kazior @ 2016-03-17  9:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Michal Kazior

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: 3e58044b61a9 ("ath10k: print crc32 checksums for firmware and board files")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 076d29b53ddf..5587f167bcdc 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -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));
 
@@ -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)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath10k: fix null deref if device crashes early
  2016-03-17  9:52 [PATCH] ath10k: fix null deref if device crashes early Michal Kazior
@ 2016-03-23 12:09 ` Valo, Kalle
  0 siblings, 0 replies; 2+ messages in thread
From: Valo, Kalle @ 2016-03-23 12:09 UTC (permalink / raw)
  To: michal.kazior@tieto.com
  Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org

Michal Kazior <michal.kazior@tieto.com> writes:

> 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: 3e58044b61a9 ("ath10k: print crc32 checksums for firmware and board files")
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

Applied, thanks.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-23 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-17  9:52 [PATCH] ath10k: fix null deref if device crashes early Michal Kazior
2016-03-23 12:09 ` Valo, Kalle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).