]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mt76: mt7615: remove key check in mt7615_mcu_set_wtbl_key
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 4 Jun 2019 22:12:20 +0000 (00:12 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 27 Jun 2019 10:58:13 +0000 (12:58 +0200)
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>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c

index f2f6b77666f82ef697ee54bfd1932d1392ab75ff..76431d00a8ac0c57c88cf4ec2ff133f336ab5902 100644 (file)
@@ -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;