From: Sergey Matyukevich Date: Tue, 29 Aug 2017 12:16:22 +0000 (+0300) Subject: qtnfmac: fix free_xfer_buffer cleanup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b00edea3ed5fd4241d211671602d7a39d9482295;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git qtnfmac: fix free_xfer_buffer cleanup Check if skb tracking arrays has been already allocated. This additional check handles the case when init partially failed. Signed-off-by: Sergey Matyukevich Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index bfbcd0bf75bf..2921d8069bf2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -483,7 +483,7 @@ static void free_xfer_buffers(void *data) /* free rx buffers */ for (i = 0; i < priv->rx_bd_num; i++) { - if (priv->rx_skb[i]) { + if (priv->rx_skb && priv->rx_skb[i]) { rxbd = &priv->rx_bd_vbase[i]; paddr = QTN_HOST_ADDR(le32_to_cpu(rxbd->addr_h), le32_to_cpu(rxbd->addr)); @@ -496,7 +496,7 @@ static void free_xfer_buffers(void *data) /* free tx buffers */ for (i = 0; i < priv->tx_bd_num; i++) { - if (priv->tx_skb[i]) { + if (priv->tx_skb && priv->tx_skb[i]) { dev_kfree_skb_any(priv->tx_skb[i]); priv->tx_skb[i] = NULL; }