mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
wifi: mt76: mt7996: avoid NULL pointer dereference in mt7996_set_monitor()
The function mt7996_set_monitor() dereferences phy before
the NULL sanity check.
Fix this to avoid NULL pointer dereference by moving the
dereference after the check.
Fixes: 69d54ce749 ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Link: https://patch.msgid.link/20250421112544.13430-1-qasdev00@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
7011faebe5
commit
cb423ddad0
|
|
@ -414,11 +414,13 @@ static void mt7996_phy_set_rxfilter(struct mt7996_phy *phy)
|
|||
|
||||
static void mt7996_set_monitor(struct mt7996_phy *phy, bool enabled)
|
||||
{
|
||||
struct mt7996_dev *dev = phy->dev;
|
||||
struct mt7996_dev *dev;
|
||||
|
||||
if (!phy)
|
||||
return;
|
||||
|
||||
dev = phy->dev;
|
||||
|
||||
if (enabled == !(phy->rxfilter & MT_WF_RFCR_DROP_OTHER_UC))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user