linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] ath11k: fix missing error check on call to ath11k_pci_get_user_msi_assignment
@ 2020-08-19 11:14 Colin King
  2020-08-31 15:16 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-08-19 11:14 UTC (permalink / raw)
  To: Kalle Valo, David S . Miller, Jakub Kicinski, Carl Huang, ath11k,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The return error check on the call to ath11k_pci_get_user_msi_assignment is
missing.  If an error does occur, num_vectors is still set to zero and
later on a division by zero can occur when variable vector is being
calculated.  Fix this by adding an error check after the call.

Addresses-Coverity: ("Division or modulo by zero")
Fixes: d4ecb90b3857 ("ath11k: enable DP interrupt setup for QCA6390")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/ath/ath11k/pci.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
index ca7012d46c3f..058885776a3a 100644
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -648,9 +648,12 @@ static int ath11k_pci_ext_irq_config(struct ath11k_base *ab)
 	int i, j, ret, num_vectors = 0;
 	u32 user_base_data = 0, base_vector = 0;
 
-	ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), "DP",
-					   &num_vectors, &user_base_data,
-					   &base_vector);
+	ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), "DP",
+						 &num_vectors,
+						 &user_base_data,
+						 &base_vector);
+	if (ret < 0)
+		return ret;
 
 	for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
 		struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
-- 
2.27.0


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

* Re: [PATCH][next] ath11k: fix missing error check on call to ath11k_pci_get_user_msi_assignment
  2020-08-19 11:14 [PATCH][next] ath11k: fix missing error check on call to ath11k_pci_get_user_msi_assignment Colin King
@ 2020-08-31 15:16 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-08-31 15:16 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, Jakub Kicinski, Carl Huang, ath11k,
	linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> The return error check on the call to ath11k_pci_get_user_msi_assignment is
> missing.  If an error does occur, num_vectors is still set to zero and
> later on a division by zero can occur when variable vector is being
> calculated.  Fix this by adding an error check after the call.
> 
> Addresses-Coverity: ("Division or modulo by zero")
> Fixes: d4ecb90b3857 ("ath11k: enable DP interrupt setup for QCA6390")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

b2c094582e38 ath11k: fix missing error check on call to ath11k_pci_get_user_msi_assignment

-- 
https://patchwork.kernel.org/patch/11723523/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2020-08-31 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 11:14 [PATCH][next] ath11k: fix missing error check on call to ath11k_pci_get_user_msi_assignment Colin King
2020-08-31 15:16 ` Kalle Valo

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).