From patchwork Fri Apr 26 15:43:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 10919281 X-Patchwork-Delegate: kvalo@adurom.com 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 E25D514C0 for ; Fri, 26 Apr 2019 15:50:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D046728C4E for ; Fri, 26 Apr 2019 15:50:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C487C28CBE; Fri, 26 Apr 2019 15:50:02 +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=-7.9 required=2.0 tests=BAYES_00,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 9A1C028C5A for ; Fri, 26 Apr 2019 15:50:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfDZPuB (ORCPT ); Fri, 26 Apr 2019 11:50:01 -0400 Received: from alexa-out-ams-02.qualcomm.com ([185.23.61.163]:21644 "EHLO alexa-out-ams-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbfDZPt7 (ORCPT ); Fri, 26 Apr 2019 11:49:59 -0400 X-IronPort-AV: E=Sophos;i="5.60,398,1549926000"; d="scan'208";a="2367517" Received: from ironmsg01-ams.qualcomm.com ([10.251.56.2]) by alexa-out-ams-02.qualcomm.com with ESMTP; 26 Apr 2019 17:43:41 +0200 X-IronPort-AV: E=McAfee;i="5900,7806,9238"; a="7889765" Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg01-ams.qualcomm.com with ESMTP; 26 Apr 2019 17:43:41 +0200 From: Maya Erez To: Kalle Valo Cc: Alexei Avshalom Lazar , linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com, Maya Erez Subject: [PATCH 2/9] wil6210: fix _desc access in __wil_tx_vring_tso Date: Fri, 26 Apr 2019 18:43:30 +0300 Message-Id: <1556293417-27097-3-git-send-email-merez@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556293417-27097-1-git-send-email-merez@codeaurora.org> References: <1556293417-27097-1-git-send-email-merez@codeaurora.org> 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 From: Alexei Avshalom Lazar _desc is defined in __wil_tx_vring_tso() and may not be set in case len is 0, verify _desc is set. Signed-off-by: Alexei Avshalom Lazar Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/txrx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 4ccfd14..a8f315b 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -1760,6 +1760,9 @@ static int __wil_tx_vring_tso(struct wil6210_priv *wil, struct wil6210_vif *vif, } } + if (!_desc) + goto mem_error; + /* first descriptor may also be the last. * in this case d pointer is invalid */