From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E5767B; Thu, 13 Oct 2022 00:27:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8513C433D6; Thu, 13 Oct 2022 00:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620862; bh=iAeGZmsKjydsBLHiMAO8DotHdDVpqUavlWoIH5JH2gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gebqqeg9uCjdg5QvxjVN0lppJL2s0idQ7GC/i3m5p0oS9AScivxlk+sVbPwaW2288 NMD0HBvd1vKbCuKfAaPydmMARoGTXB9ZV+6A1JNDlcm2bwCVcGoM5tTCA6Du0W6ly6 xJBiGKuGMjeVRiA64epdjIkgNys18IXhMPUSfyzaNruDQP+n/imO1EfuvQ5Gg7YqZL ggHKO7JmJJk6wmz/ZWmBU7Qfs/1YEfv0ykor/OGCUTP1iYocj4jNg00OeHITq230A0 ZBFaasKf75VkbZL2HgxnXAY8geYGvoReOMmQ5eNJHpMXHxbC/ERF7gsbmpdLVGpowg MtDlIJB3KaL1w== 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 4.14 11/13] staging: rtl8192u: Fix return type of ieee80211_xmit Date: Wed, 12 Oct 2022 20:27:10 -0400 Message-Id: <20221013002716.1895839-11-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013002716.1895839-1-sashal@kernel.org> References: <20221013002716.1895839-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit 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 b062cad052b9..2e768e21e26b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2186,7 +2186,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 f58971a4a2e3..70cc158d79bc 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -594,7 +594,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; @@ -902,13 +902,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