Commit 47021bed authored by Hongchen Zhang's avatar Hongchen Zhang
Browse files

net: stmmac: fix potential double free of dma descriptor resources

LoongArch inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I733VA



--------------------------------

reset the dma descriptor related resource's pointer to NULL,otherwise
a potential double free problem may be triggered:
stmmac_open
  alloc_dma_desc_resources
  init_dma_desc_rings
  stmmac_hw_setup  (Failed)
    goto init_error;
  free_dma_desc_resources(priv);
  (DMA related resource pointer not reset to NULL)
...
stmmac_open
  alloc_dma_desc_resources
    alloc_dma_tx_desc_resources (Failed)
      free_dma_tx_desc_resources
      (Double free of tx_q->tx_skbuff_dma tx_q->tx_skbuff)

Signed-off-by: default avatarHongchen Zhang <zhanghongchen@loongson.cn>
Change-Id: Ie917b7402e86cbd1b253553c10ac4a5440e38c03
parent f3014d9a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment