mt7603: add more checks to avoid dereferencing invalid pointers in wcid lookup

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2018-04-15 10:14:46 +02:00
parent d9e5da36e2
commit a8e8921559
+6
View File
@@ -363,7 +363,13 @@ mt7603_rx_get_wcid(struct mt7603_dev *dev, u8 idx, bool unicast)
if (unicast || !wcid)
return wcid;
if (!wcid->sta)
return NULL;
sta = container_of(wcid, struct mt7603_sta, wcid);
if (!sta->vif)
return NULL;
return &sta->vif->wcid;
}