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

2017-07-19 Thread Coelho, Luciano
On Wed, 2017-07-19 at 11:21 +0300, Dan Carpenter wrote:
> Oops, heh, sorry.  I switched computers so I first one wasn't in my
> outbox.

No worries, better safe than sorry. :)

--
Luca.

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

2017-07-19 Thread Dan Carpenter
Oops, heh, sorry.  I switched computers so I first one wasn't in my
outbox.

regards,
dan carpenter



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

2017-07-19 Thread Coelho, Luciano
Hi Dan,

On Wed, 2017-07-12 at 10:53 +0300, Dan Carpenter wrote:
> 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 
> 
> 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(_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);

You already sent an equivalent patch:

https://patchwork.kernel.org/patch/9825895/

And I've already sent it out to be applied in 4.13-rc*.  I'll send a
pull-req for -fixes later this week.

Thanks anyway. :)

--
Cheers,
Luca.

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

2017-07-12 Thread Dan Carpenter
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 

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(_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);