public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [bug report] wifi: mt76: mt7996: Integrate MT7990 dma configuration for NPU
Date: Fri, 10 Apr 2026 13:13:43 +0300	[thread overview]
Message-ID: <adjNVyjGFNxvJIW8@stanley.mountain> (raw)

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


                 reply	other threads:[~2026-04-10 10:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adjNVyjGFNxvJIW8@stanley.mountain \
    --to=error27@gmail.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox