2017-07-12 07:53:16

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] iwlwifi: pcie: Fix error code in iwl_trans_pcie_alloc()

We accidentally forgot to propogate the error code on this path. It
means we return ERR_PTR(0) which is NULL and it results in a NULL
dereference in the caller.

Fixes: 2e5d4a8f61dc ("iwlwifi: pcie: Add new configuration to enable MSIX")
Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 92b3a55d0fbc..f95eec52508e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -3150,7 +3150,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
init_waitqueue_head(&trans_pcie->d0i3_waitq);

if (trans_pcie->msix_enabled) {
- if (iwl_pcie_init_msix_handler(pdev, trans_pcie))
+ ret = iwl_pcie_init_msix_handler(pdev, trans_pcie);
+ if (ret)
goto out_no_pci;
} else {
ret = iwl_pcie_alloc_ict(trans);


2017-07-19 08:22:10

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: pcie: Fix error code in iwl_trans_pcie_alloc()

Oops, heh, sorry. I switched computers so I first one wasn't in my
outbox.

regards,
dan carpenter

2017-07-19 08:23:17

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: pcie: Fix error code in iwl_trans_pcie_alloc()

T24gV2VkLCAyMDE3LTA3LTE5IGF0IDExOjIxICswMzAwLCBEYW4gQ2FycGVudGVyIHdyb3RlOg0K
PiBPb3BzLCBoZWgsIHNvcnJ5LiAgSSBzd2l0Y2hlZCBjb21wdXRlcnMgc28gSSBmaXJzdCBvbmUg
d2Fzbid0IGluIG15DQo+IG91dGJveC4NCg0KTm8gd29ycmllcywgYmV0dGVyIHNhZmUgdGhhbiBz
b3JyeS4gOikNCg0KLS0NCkx1Y2Eu

2017-07-19 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