mirror of
https://github.com/torvalds/linux.git
synced 2024-11-02 02:01:29 +00:00
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 <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
bab5dac73c
commit
b00edea3ed
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user