On Thu, 28 Sep 2023 09:06:28 +0200 Herve Codina wrote: > +static int qmc_hdlc_close(struct net_device *netdev) > +{ > + struct qmc_hdlc *qmc_hdlc = netdev_to_qmc_hdlc(netdev); > + struct qmc_hdlc_desc *desc; > + int i; > + > + netif_stop_queue(netdev); > + > + qmc_chan_stop(qmc_hdlc->qmc_chan, QMC_CHAN_ALL); > + qmc_chan_reset(qmc_hdlc->qmc_chan, QMC_CHAN_ALL); stopping the queue looks a bit racy, a completion may come in and restart the queue > + for (i = 0; i < ARRAY_SIZE(qmc_hdlc->tx_descs); i++) { > + desc = &qmc_hdlc->tx_descs[i]; > + if (!desc->skb) > + continue; > + dma_unmap_single(qmc_hdlc->dev, desc->dma_addr, desc->dma_size, > + DMA_TO_DEVICE); > + kfree_skb(desc->skb); > + desc->skb = NULL; > + } > + > + for (i = 0; i < ARRAY_SIZE(qmc_hdlc->rx_descs); i++) { > + desc = &qmc_hdlc->rx_descs[i]; > + if (!desc->skb) > + continue; > + dma_unmap_single(qmc_hdlc->dev, desc->dma_addr, desc->dma_size, > + DMA_FROM_DEVICE); > + kfree_skb(desc->skb); > + desc->skb = NULL; > + } > + > + hdlc_close(netdev);