Skip to content

Commit 73ea735

Browse files
nhukcdavem330
authored andcommitted
net: sparx5: Fix return type of sparx5_port_xmit_impl
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. Reported-by: Dan Carpenter <[email protected]> Link: ClangBuiltLinux#1703 Cc: [email protected] Signed-off-by: Nathan Huckleberry <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7a62ed6 commit 73ea735

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ struct frame_info {
291291
void sparx5_xtr_flush(struct sparx5 *sparx5, u8 grp);
292292
void sparx5_ifh_parse(u32 *ifh, struct frame_info *info);
293293
irqreturn_t sparx5_xtr_handler(int irq, void *_priv);
294-
int sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev);
294+
netdev_tx_t sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev);
295295
int sparx5_manual_injection_mode(struct sparx5 *sparx5);
296296
void sparx5_port_inj_timer_setup(struct sparx5_port *port);
297297

drivers/net/ethernet/microchip/sparx5/sparx5_packet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ static int sparx5_inject(struct sparx5 *sparx5,
222222
return NETDEV_TX_OK;
223223
}
224224

225-
int sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev)
225+
netdev_tx_t sparx5_port_xmit_impl(struct sk_buff *skb, struct net_device *dev)
226226
{
227227
struct net_device_stats *stats = &dev->stats;
228228
struct sparx5_port *port = netdev_priv(dev);
229229
struct sparx5 *sparx5 = port->sparx5;
230230
u32 ifh[IFH_LEN];
231-
int ret;
231+
netdev_tx_t ret;
232232

233233
memset(ifh, 0, IFH_LEN * 4);
234234
sparx5_set_port_ifh(ifh, port->portno);

0 commit comments

Comments
 (0)