Lorenzo Bianconi <lorenzo@xxxxxxxxxx> writes: >@@ -471,16 +468,6 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, > } > mt76_wcid_key_setup(&dev->mt76, wcid, key); > >- if (!msta) { >- if (key || wcid->hw_key_idx == idx) { >- ret = mt76x02_mac_wcid_set_key(dev, wcid->idx, key); >- if (ret) >- return ret; >- } >- >- return mt76x02_mac_shared_key_setup(dev, mvif->idx, idx, key); >- } >- > return mt76x02_mac_wcid_set_key(dev, msta->wcid.idx, key); > } > EXPORT_SYMBOL_GPL(mt76x02_set_key); `msta` may be a null pointer. This patch may cause data to be written to a null pointer in `return mt76x02_mac_wcid_set_key(dev, msta->wcid.idx, key);`.