Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp136301rwi; Wed, 12 Oct 2022 17:23:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nXnkoOymlIiKkYI2ntmcbmUZpxMLAAeNPQ0KAABG5YIEwPd7EMJXV2tm58XULmyZ+ppqw X-Received: by 2002:a05:6402:368:b0:458:9b5e:fd35 with SMTP id s8-20020a056402036800b004589b5efd35mr298587edw.141.1665620625120; Wed, 12 Oct 2022 17:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665620625; cv=none; d=google.com; s=arc-20160816; b=DFYy44re3M/26/vhApnI+zZaKF/BVGqGrmyAoQd1Iwlb9E5Lg/TbtXySXA7YcOSlUu YwKXrJOGURyRFgKR7ayo0Dvr3S6rOu4imgXtfR8MaGvvbV1hDXiMsPn+m2rl7P2UH2wa bk0fK4NEJz9YitBe9G0TIiBtNtjH4SwL3iYTzvwNFxwjqAPBuhrsPOJuXxu/iINc70kl TKj6ujj03sPjq6RJfkFDi1MnBdDkRM5KzuknS7v+fYupsMfksSH/YLmi7+lBCnGARI1M jCwkOCZgXqTuZbmTxTjd8q5yROjVR+lBzwbtcxicxOA+WgvqaX1l3gCwQMXqX7KSEBfv qGsg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mZUhooT/UFbsHPq1ozUP7Vs5TeyJiGUF9VCCrPpNsFA=; b=PVqIwiItjC0ZI5i68ttsAsLnjR/pWtIZFPEiT05Fnb9XoqaleyKu9nDlfeuWSnji7f 65ZJHipRp6ZMj1kVAcTBdI8F2svwZBMahcjnDLq/kuw9sFuS1mowuk2T8j+7aEbBq56O 7O26ClygRKFkm5Wrxs1kZshswGBKr+rJDzD9PAm2SxZdpSmsAVlVtxwzZ7qt6rHLuYQE RIW3ZJuDBo/PoGixwI2TgFi3NSbnEJb0ElqC5cG/RzyD795MJH3RUGNy+GWECLatK9Ir bcxmpEcTWDf+H38cQEAfp8yI1GaJb0l/4fdezzctEn17figoXdxtQTkBpTQ5ki4ePVm+ soRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=INbm51gn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020a05640251d200b0044e9ca6880bsi19743230edd.364.2022.10.12.17.23.18; Wed, 12 Oct 2022 17:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=INbm51gn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S230193AbiJMAVs (ORCPT + 99 others); Wed, 12 Oct 2022 20:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiJMAVL (ORCPT ); Wed, 12 Oct 2022 20:21:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E0C15E0E9; Wed, 12 Oct 2022 17:18:07 -0700 (PDT) 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 DC2B6B81CC1; Thu, 13 Oct 2022 00:17:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B7E7C433D6; Thu, 13 Oct 2022 00:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620268; bh=c7RVjqcmClAXhrEggnXFpKNhPPpv6Yk6Q3YUARexdQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INbm51gn84E8UcT1xJkLG62s1TV4fKbkbV/QtUOWaZge8txmtIkgDmuM48k+8k5aG OxioXl/+UobxtI9PzWzvx2KuEMTTleF+vCAICX0JPoJDfcdIM+TtnJNbmLqMCAp/NX QFp4XhNzpKoCPQGGXuNtUYsbUjWhzqXyRZzUMOrkTXy3JZE++HyczxsGxJfO99uYrb jkvke8HKnUs4DBvvvAjQJCk69Jk0+qfwi4YXbp5oF1Azr8g4MMADTSqB9z0tuwqlOL Pb5M2LBYYivpUD9WlBxAeYXPwJjQ74aC9FcaIPF3A6R9qvke9HaZaVB5bG5BK6DAWD dzvdLBpA6ySww== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Huckleberry , llvm@lists.linux.dev, Dan Carpenter , Nathan Chancellor , Greg Kroah-Hartman , Sasha Levin , ndesaulniers@google.com, ztong0001@gmail.com, dave@stgolabs.net, linux-staging@lists.linux.dev Subject: [PATCH AUTOSEL 6.0 47/67] staging: rtl8192u: Fix return type of ieee80211_xmit Date: Wed, 12 Oct 2022 20:15:28 -0400 Message-Id: <20221013001554.1892206-47-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Huckleberry [ Upstream commit 2851349ac351010a2649e0ff86a1e3d68fe5d683 ] The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of ieee80211_xmit should be changed from int to netdev_tx_t. Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Reported-by: Dan Carpenter Reviewed-by: Nathan Chancellor Signed-off-by: Nathan Huckleberry Link: https://lore.kernel.org/r/20220914210750.423048-1-nhuck@google.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 +- drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index b577f9c81f85..9cd4b1896745 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2178,7 +2178,7 @@ int ieee80211_set_encryption(struct ieee80211_device *ieee); int ieee80211_encrypt_fragment(struct ieee80211_device *ieee, struct sk_buff *frag, int hdr_len); -int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); +netdev_tx_t ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); void ieee80211_txb_free(struct ieee80211_txb *txb); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 8602e3a6c837..e4b6454809a0 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -526,7 +526,7 @@ static void ieee80211_query_seqnum(struct ieee80211_device *ieee, } } -int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) +netdev_tx_t ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) { struct ieee80211_device *ieee = netdev_priv(dev); struct ieee80211_txb *txb = NULL; @@ -822,13 +822,13 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) if ((*ieee->hard_start_xmit)(txb, dev) == 0) { stats->tx_packets++; stats->tx_bytes += __le16_to_cpu(txb->payload_size); - return 0; + return NETDEV_TX_OK; } ieee80211_txb_free(txb); } } - return 0; + return NETDEV_TX_OK; failed: spin_unlock_irqrestore(&ieee->lock, flags); -- 2.35.1