ath11k: fix missing error check on call to ath11k_pci_get_user_msi_assignment
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: d4ecb90b38 ("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>
Link: https://lore.kernel.org/r/20200819111452.52419-1-colin.king@canonical.com
This commit is contained in:
parent
bd5dd7aaa4
commit
b2c094582e
1 changed files with 6 additions and 3 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue