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 EBC1A1FAA for ; Tue, 13 Sep 2022 22:31:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCF60C433D6; Tue, 13 Sep 2022 22:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663108273; bh=CNNrVQXB5RHuPodp+2y8dbJdbh0v4jEbTVcWCwUBVJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EbqSYOgNEkHCFSyUVPMegTUCUfNLiMKR0LTwYTZtN9tc17hwbQ0EGsw86v2JHL/tx JHERYk/ldz2bA32a5EZWSyDA1O/o/PlTIvWEhrUUwOetpXFuqOf7zFgjzzNLZ0r1eS iWiKaoRv4gPJUKdQCrvOHNjIGgnvt7GmX4s+eHxlFPc+bgJm3mUx990MxiU2EF0QrU G/amDn3Tw7t3m50Vo/i8tNUZG5Z95Mr6uf3o+aCnopIjsP6vfGnNZVoltVB06CAY7v f5kHtG1jv4A/yTM2uQj/bfWc04dKIUhn6KFWTy1DbxF2UYXOZhMyxuFiDao9HIUPkP 3rxQaLLMx/IEQ== Date: Tue, 13 Sep 2022 15:31:11 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Karol Gugala , Mateusz Holenko , Gabriel Somlo , Joel Stanley , Nick Desaulniers , Tom Rix , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: ethernet: litex: Fix return type of liteeth_start_xmit Message-ID: References: <20220912195307.812229-1-nhuck@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912195307.812229-1-nhuck@google.com> On Mon, Sep 12, 2022 at 12:53:07PM -0700, Nathan Huckleberry wrote: > 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 liteeth_start_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 > --- > drivers/net/ethernet/litex/litex_liteeth.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/litex/litex_liteeth.c b/drivers/net/ethernet/litex/litex_liteeth.c > index fdd99f0de424..35f24e0f0934 100644 > --- a/drivers/net/ethernet/litex/litex_liteeth.c > +++ b/drivers/net/ethernet/litex/litex_liteeth.c > @@ -152,7 +152,8 @@ static int liteeth_stop(struct net_device *netdev) > return 0; > } > > -static int liteeth_start_xmit(struct sk_buff *skb, struct net_device *netdev) > +static netdev_tx_t liteeth_start_xmit(struct sk_buff *skb, > + struct net_device *netdev) > { > struct liteeth *priv = netdev_priv(netdev); > void __iomem *txbuffer; > -- > 2.37.2.789.g6183377224-goog >