From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6223DC4332F for ; Sun, 9 Oct 2022 22:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233038AbiJIWql (ORCPT ); Sun, 9 Oct 2022 18:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232404AbiJIWok (ORCPT ); Sun, 9 Oct 2022 18:44:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C01F44552; Sun, 9 Oct 2022 15:23:23 -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 0C45BB80D33; Sun, 9 Oct 2022 22:22:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0EC7C433C1; Sun, 9 Oct 2022 22:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665354144; bh=y5mG2GGzIztP7Kf9lsArphK1NBU+oWQ6vI5czE0seOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UD7Y+t8KooPUxgAjVPyYN+mgm3nzZFJZR9NUjy5HlGE3VFRh3PiZjJLkDqlV8Ogws WFe91f09oqUf23LrOmWj+r0C+SJFlxDqMWA2mETBNpXbexNnA7HE1oHLv/Ns+mAN1M VdIqJIaaxGDvDZ8/jwMJKF/PDSLdWLRGgHaPHBcsUSYUN+x1qasYGa5ttTPhQj9OV9 cJESLn6fiYFKJ7NBuUimAVfSsxTuIb2AlzWaYMxEPtyKuVAvO3A+la+TAj5yWDLKVl iRZ8Uvt8aoFJW7zqv16CDrmhnBLopJi0AoY1RRtpbkJKi7keKGyNEC4HRnfGX1jGqv LiydWX+ecCzEA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, Nathan Chancellor , Jakub Kicinski , Sasha Levin , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, ndesaulniers@google.com, prabhakar.mahadev-lad.rj@bp.renesas.com, petrm@nvidia.com, khalasa@piap.pl, bigunclemax@gmail.com, wsa+renesas@sang-engineering.com, chi.minghao@zte.com.cn, linux-omap@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 17/34] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Date: Sun, 9 Oct 2022 18:21:11 -0400 Message-Id: <20221009222129.1218277-17-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009222129.1218277-1-sashal@kernel.org> References: <20221009222129.1218277-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nathan Huckleberry [ Upstream commit 5972ca946098487c5155fe13654743f9010f5ed5 ] 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 emac_dev_xmit should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220912195023.810319-1-nhuck@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/davinci_emac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index ad5293571af4..1dbba3e8ce50 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -942,7 +942,7 @@ static void emac_tx_handler(void *token, int len, int status) * * Returns success(NETDEV_TX_OK) or error code (typically out of desc's) */ -static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev) +static netdev_tx_t emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev) { struct device *emac_dev = &ndev->dev; int ret_code; -- 2.35.1