lkml.org 
[lkml]   [2022]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: sparx5: Fix return type of sparx5_port_xmit_impl
Hi,

On 2022-09-12 14:44, 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 sparx5_port_xmit_impl should be changed from int to
> netdev_tx_t.

I noticed that the functions that assign the return value inside
sparx5_port_xmit_impl also have return type int, which would ideally
also be changed. But a bigger issue might be that
sparx5_ptp_txtstamp_request and sparx5_inject (called inside
sparx5_port_xmit_impl) returns -EBUSY (-16), when they should return
NETDEV_TX_BUSY (16). If this is an issue then it also needs to be fixed.

sparx5_fdma_xmit also has int return type, but always returns
NETDEV_TX_OK right now.

Best Regards,
Casper

\
 
 \ /
  Last update: 2022-09-13 10:16    [W:0.700 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site