staging: rtl8712: Fix return type for implementation of ndo_start_xmit
authorGUO Zihua <guozihua@huawei.com>
Mon, 5 Sep 2022 13:02:30 +0000 (21:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Sep 2022 07:55:24 +0000 (09:55 +0200)
commit307d343620e1fc7a6a2b7a1cdadb705532c9b6a5
treedf7d00495d1dc4ae4f64048b37b8224cbc15bb3d
parentb863ce8cf619ed2c836998fcae06d9ca0c792946
staging: rtl8712: Fix return type for implementation of ndo_start_xmit

CFI (Control Flow Integrity) is a safety feature allowing the system to
detect and react should a potential control flow hijacking occurs. In
particular, the Forward-Edge CFI protects indirect function calls by
ensuring the prototype of function that is actually called matches the
definition of the function hook.

Since Linux now supports CFI, it will be a good idea to fix mismatched
return type for implementation of hooks. Otherwise this would get
cought out by CFI and cause a panic.

Use enums from netdev_tx_t as return value instead, then change return
type to netdev_tx_t.

Signed-off-by: GUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20220905130230.11230-1-guozihua@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/xmit_linux.c
drivers/staging/rtl8712/xmit_osdep.h