wifi: mt76: mt7996: Fix null-ptr-deref in mt7996_mmio_wed_init()
[ Upstream commit 8f30e2b059757d8711a823e4c9c023db62a1d171 ]
devm_ioremap() returns NULL on error. Currently, mt7996_mmio_wed_init()
does not check for this case, which results in a NULL pointer
dereference.
Prevent null pointer dereference in mt7996_mmio_wed_init()
Fixes: 83eafc9251 ("wifi: mt76: mt7996: add wed tx support")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Link: https://patch.msgid.link/20250407032349.83360-1-bsdhenrymartin@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
df00f9147e
commit
1072fc0ca1
@@ -323,6 +323,9 @@ int mt7996_mmio_wed_init(struct mt7996_dev *dev, void *pdev_ptr,
|
||||
wed->wlan.base = devm_ioremap(dev->mt76.dev,
|
||||
pci_resource_start(pci_dev, 0),
|
||||
pci_resource_len(pci_dev, 0));
|
||||
if (!wed->wlan.base)
|
||||
return -ENOMEM;
|
||||
|
||||
wed->wlan.phy_base = pci_resource_start(pci_dev, 0);
|
||||
|
||||
if (hif2) {
|
||||
|
||||
Reference in New Issue
Block a user