Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3708315pxb; Mon, 24 Jan 2022 15:59:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSJGbwXZJL40itUxJWhuwZSC5b6p1XeW6+2N27EUzldrWUEqOAZZmheoI2SOjaNKOHPLr8 X-Received: by 2002:a17:902:d512:b0:14b:71b8:1d84 with SMTP id b18-20020a170902d51200b0014b71b81d84mr1167354plg.23.1643068775112; Mon, 24 Jan 2022 15:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068775; cv=none; d=google.com; s=arc-20160816; b=Mo5SeG32I4KyaoIvNEjO7l+h4ugA28FnchlzzgSKf7x3OCySHMRS/ihTkpTEYygbmr JiCQccZL8eHxb1Dyo5pbA3bEYw+uG6E084hBIBxp5hRuHW+v3fcGcjelOnOBTTV70nOR bffiVmBl4RkQRANYcliojRKp1dVu8QqNi9JSoZQD9eqrLlsIoSvXOapCz4flCnI3/tBa JZIr4LHFpRJnK+47iI4QR48O1ZN2fHj6RChSEbiwJI7jyy8zagQrO5SIvXakOo3MrB0T Dj7escRj6Xw0JzZgRC9jidD9R4yeE/aUeZYrnNM++QCIfO7BRcblV+rSj05fp7Ahx+pZ 5AiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B0eeRJWH+yj2fx6YtCJgQ6aLV7gza5uWzVY8hvajcDg=; b=mLzUeCUWTazfXuwD6as/EPjiuK+t/PxWEariNkZhr/USG2xtd4I4Wc3GbxOPjp5kld W/JhFw2jhZvQzIyK43cc2bgO48eXnwl4OskzqQZrh6wDLfuWWzIIlCaZ1Qta6/ifdSKI K8sHq0l47iNzZLkg0oFra5dfV7DdY1BdOnvJ0mjU8XRsquvpjXw+xOLftp0k7JkbISaN 6kNVFQoIukuEKcQDZ7xAO29eBDxcGcjxu4sOnFGFz5edqOP0QIFQy4gts5dEJMzYsDo8 Bsy5aQ9TQT/fraycOiNOypvgcnPqmmn8YoVqJn+Gez3Ujxagvpav3TNYn5sdBN5hRXzD sjlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=faStgG3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si696960pjp.108.2022.01.24.15.59.23; Mon, 24 Jan 2022 15:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=faStgG3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2367712AbiAXX4T (ORCPT + 99 others); Mon, 24 Jan 2022 18:56:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846417AbiAXXPz (ORCPT ); Mon, 24 Jan 2022 18:15:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E6ECC0604D4; Mon, 24 Jan 2022 13:24:42 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 45C0CB81057; Mon, 24 Jan 2022 21:24:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76B06C340E4; Mon, 24 Jan 2022 21:24:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059480; bh=s5IjFqMJ/dT0kIt8h9WrHQlrzu3r9T+bGFdI2o8kycU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=faStgG3usJ/cAuKUTaCxnkhU0DChE5nEKJTr+TmFPi7QDGqs0jpdB5NavhR6aYywA uPZvHJlXTxMUDV64v4cCW8sZLoIyRwzSzyGAy3UP8Aye23iqBjGnCai0L9e7XS7PCr kTKZbWor4xBVieC93suXk0U2kyFqIZ/mTwegVmbI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 5.16 0630/1039] rtw89: dont kick off TX DMA if failed to write skb Date: Mon, 24 Jan 2022 19:40:19 +0100 Message-Id: <20220124184146.526481637@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ping-Ke Shih [ Upstream commit a58fdb7c843a37d6598204c6513961feefdadc6a ] This is found by Smatch static checker warning: drivers/net/wireless/realtek/rtw89/mac80211.c:31 rtw89_ops_tx() error: uninitialized symbol 'qsel'. The warning is because 'qsel' isn't filled by rtw89_core_tx_write() due to failed to write. The way to fix it is to avoid kicking off TX DMA, so add 'return' to the failure case. Reported-by: Dan Carpenter Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201093816.13806-1-pkshih@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw89/mac80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c index 16dc6fb7dbb0b..e9d61e55e2d92 100644 --- a/drivers/net/wireless/realtek/rtw89/mac80211.c +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c @@ -27,6 +27,7 @@ static void rtw89_ops_tx(struct ieee80211_hw *hw, if (ret) { rtw89_err(rtwdev, "failed to transmit skb: %d\n", ret); ieee80211_free_txskb(hw, skb); + return; } rtw89_core_tx_kick_off(rtwdev, qsel); } -- 2.34.1