From patchwork Tue Jun 4 22:12:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10976191 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1AED1515 for ; Tue, 4 Jun 2019 22:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E27D228746 for ; Tue, 4 Jun 2019 22:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6BB22886C; Tue, 4 Jun 2019 22:12:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B376F28746 for ; Tue, 4 Jun 2019 22:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbfFDWMv (ORCPT ); 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;