Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5938450ybi; Tue, 4 Jun 2019 15:13:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwULhwfGU6J4B3qFuU8LkdnL54DKMnexV1tPT5UgmweWaT+q1e1ejyRQ31h0kTIIMYWHYHk X-Received: by 2002:a17:90a:a00d:: with SMTP id q13mr14439897pjp.80.1559686417713; Tue, 04 Jun 2019 15:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559686417; cv=none; d=google.com; s=arc-20160816; b=rjgiXEpYR0pMvFDwwBrWbzbe12+8BV8uQhb80knMaXbsPptlBe3FzP+gz2i6SHcLUi z2oBQsxsLTwJUloGukXQhXI8Eof1nJGZjjSnTNIqiNcP7L7ILfxWWUxutDzVOZMmB8/I tvxFi/MFYaCROqK4WFX6fbds7T1DXaZwsAHoZdK7GbzAkfxd6SqV50wH+olIh4T+4gCS nHh3mim2yZoRJcdjk1b5rLRp2ycvunNAStlW5WJMHu7mg3RFrPyPQqrUtSxy6LTfrPcr ECt47WFrBneAhdQK25VamGnyyRuOgngF4XfW4MIKYWdfVzIT3vpuGfop/WHpidVne9/R rLnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=b1MvkQuBnLgmNDaHmGi9mJ1mALy1m02wcSUY9QEvvyM=; b=sYW85k5Ti0pyAUt4DlJZfAEl+JhrRUr9QYDvLAGPq3Wl7r5VSC4ovHF2YrifhsBnbe 782lbE45F7RisRioBAnuOFpSatunedYh0KFIVYfPZ56dqu3/ng6M7Om82zciQKkEtb8p +qnPRiHDkX5pTq42SymxFExWg9MBJv35zBrMvUBD3u3P1xa6F8IC3wn8PkcWmfx4nJ9n PxBSLcTO/7WHY5ul6MKtvU5pmyND4myItu4a3a3OQtDlJCOVAEBAa706SB1MKDl4eQo7 UmA31BowzcMKv9d8YtTNqyImuxlzuli0OIphi0OVL/ib3Plcn45Su8ZeUIw/epE7qxEx WOWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QSJIDAgt; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q22si24813223pgl.124.2019.06.04.15.13.09; Tue, 04 Jun 2019 15:13:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QSJIDAgt; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbfFDWMv (ORCPT + 99 others); Tue, 4 Jun 2019 18:12:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:34630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfFDWMv (ORCPT ); Tue, 4 Jun 2019 18:12:51 -0400 Received: from localhost.localdomain (unknown [151.66.15.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF475206B8; Tue, 4 Jun 2019 22:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559686371; bh=sKy/yEBh5xWfp2mAWzv3bh0R0yH1wPIwS9LFYeZgTXg=; h=From:To:Cc:Subject:Date:From; b=QSJIDAgtJTk98w8jJi/vPGCkNvsMJ0ym5KcPVDS81ttAbCnj+wX2u7m/nLcdEguJt hpJGET0P7/UyaHTAuozRCTFZKnOuAiAu6d6kELOKJkPGHzksgnEANKobL/8eiqbHQM +32t58YdiHNHdBRrOY094+KU6tCEWwvQr1IclcxQ= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, royluo@google.com Subject: [PATCH] mt76: mt7615: remove key check in mt7615_mcu_set_wtbl_key Date: Wed, 5 Jun 2019 00:12:20 +0200 Message-Id: <51396ab29d290f95caecbb7fd817c654b74b36dc.1559686202.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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(-) 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; -- 2.21.0