Message ID | 51396ab29d290f95caecbb7fd817c654b74b36dc.1559686202.git.lorenzo@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Felix Fietkau |
Headers | show |
Series | mt76: mt7615: remove key check in mt7615_mcu_set_wtbl_key | expand |
On 2019-06-05 00:12, Lorenzo Bianconi wrote: > Do not check key pointer in mt7615_mcu_set_wtbl_key since if set_key_cmd > is SET_KEY, key will be always not NULL. This patch will address a false > positive reported by Coverity-Scan > > Addresses-Coverity-ID: 1445463 ("Dereference after null check") > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Applied, thanks. - Felix
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index d104435cd901..7a41c37e7460 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -879,7 +879,7 @@ int mt7615_mcu_set_wtbl_key(struct mt7615_dev *dev, int wcid, u8 cipher; cipher = mt7615_get_key_info(key, req.key.key_material); - if (cipher == MT_CIPHER_NONE && key) + if (cipher == MT_CIPHER_NONE) return -EOPNOTSUPP; req.key.rkv = 1;
Do not check key pointer in mt7615_mcu_set_wtbl_key since if set_key_cmd is SET_KEY, key will be always not NULL. This patch will address a false positive reported by Coverity-Scan Addresses-Coverity-ID: 1445463 ("Dereference after null check") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- This patch is based on 'mt76: mt7615: fix slow performance when enable encryption' https://patchwork.kernel.org/patch/10972385/ --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)