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 DF1E6C4332F for ; Sun, 9 Oct 2022 22:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbiJIWXB (ORCPT ); Sun, 9 Oct 2022 18:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbiJIWVx (ORCPT ); Sun, 9 Oct 2022 18:21:53 -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 1DB781CB2E; Sun, 9 Oct 2022 15:17:21 -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 9E3A5B80DDB; Sun, 9 Oct 2022 22:11:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F68CC433D7; Sun, 9 Oct 2022 22:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353503; bh=drDk/Q5G58QaH21cmrlVgYMK81JcWEHdkp3sIMzdQGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fIQx0skP3ajc88P2V1NVpN4+BznHWSaVuhqVN+2x2fq1G75SPPVQ9ZTx+KEiJ8Giw f+K1PlmazvMXTiN6AZgdRjeraChHiFOnRsurdrphJdm9IjcXgtI53WtINovdCcSasJ ZqBvq39fvATP+R7cCInZJNko7hc80ogfUtvQorP3g2CyjglwcLtX2BMiJ08f+8yeS5 HbkFdlNI8tK7+d7PFSLyMBA0XHTzaspAcsa/FLNtL0K3n7oo61h8EjTpp0pyBk1aIM sPxfWby5AMhe35RP0+X+7QgHapotjfEjumcHeCqB+joWnUVz2QZww4eq6BMcDG0znG LIl07mSpGxWyw== 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, mkl@pengutronix.de, shayagr@amazon.com, chi.minghao@zte.com.cn, bigunclemax@gmail.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 47/77] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Date: Sun, 9 Oct 2022 18:07:24 -0400 Message-Id: <20221009220754.1214186-47-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org> References: <20221009220754.1214186-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 2a3e4e842fa5..e203a5984f03 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -949,7 +949,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