* [bug report] wifi: mt76: mt7996: Integrate MT7990 dma configuration for NPU
@ 2026-04-10 10:13 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-04-10 10:13 UTC (permalink / raw)
To: Lorenzo Bianconi; +Cc: linux-wireless, linux-mediatek
Hello Lorenzo Bianconi,
Commit cd7951f242a7 ("wifi: mt76: mt7996: Integrate MT7990 dma
configuration for NPU") from Jan 22, 2026 (linux-next), leads to the
following Smatch static checker warning:
drivers/net/wireless/mediatek/mt76/mt7996/dma.c:683 mt7996_dma_init()
error: NULL dereference inside function mt7996_init_tx_queues()
drivers/net/wireless/mediatek/mt76/mt7996/dma.c
664 int mt7996_dma_init(struct mt7996_dev *dev)
665 {
666 struct mtk_wed_device *wed = &dev->mt76.mmio.wed;
667 struct mtk_wed_device *wed_hif2 = &dev->mt76.mmio.wed_hif2;
668 u32 rx_base;
669 u32 hif1_ofs = 0;
670 int ret;
671
672 mt7996_dma_config(dev);
673
674 mt76_dma_attach(&dev->mt76);
675
676 if (dev->hif2)
677 hif1_ofs = MT_WFDMA0_PCIE1(0) - MT_WFDMA0(0);
678
679 mt7996_dma_disable(dev, true);
680
681 /* init tx queue */
682 if (is_mt7996(&dev->mt76) && mt76_npu_device_active(&dev->mt76))
--> 683 ret = mt7996_init_tx_queues(&dev->phy, MT_TXQ_ID(0),
684 MT7996_NPU_TX_RING_SIZE,
685 MT_TXQ_RING_BASE(0) + hif1_ofs,
686 NULL);
^^^^
Can't pass NULL here. It leads to a crash. Use wed?
687 else
688 ret = mt7996_init_tx_queues(&dev->phy,
689 MT_TXQ_ID(dev->mphy.band_idx),
690 MT7996_TX_RING_SIZE,
691 MT_TXQ_RING_BASE(0), wed);
692 if (ret)
693 return ret;
694
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-10 10:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 10:13 [bug report] wifi: mt76: mt7996: Integrate MT7990 dma configuration for NPU Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox