diff options
author | Kees Cook <keescook@chromium.org> | 2019-11-15 09:28:28 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-16 14:41:02 +0100 |
commit | 6cfed598480493d814414ce7e53027bd6fc45c49 (patch) | |
tree | d70faf7d114efd55fab70df1e589cb3eeeab308e /drivers/staging/rtl8192u | |
parent | 2611045e3555cd0d75837ae69ffd70ef51e28bf7 (diff) | |
download | linux-6cfed598480493d814414ce7e53027bd6fc45c49.tar.gz linux-6cfed598480493d814414ce7e53027bd6fc45c49.tar.bz2 linux-6cfed598480493d814414ce7e53027bd6fc45c49.zip |
staging: rtl*: Remove tasklet callback casts
In order to make the entire kernel usable under Clang's Control Flow
Integrity protections, function prototype casts need to be avoided
because this will trip CFI checks at runtime (i.e. a mismatch between
the caller's expected function prototype and the destination function's
prototype). Many of these cases can be found with -Wcast-function-type,
which found that the rtl wifi drivers had a bunch of needless function
casts. Remove function casts for tasklet callbacks in the various drivers.
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/201911150926.2894A4F973@keescook
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 7 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 8 |
2 files changed, 7 insertions, 8 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index bd5b554787d1..90692db81b71 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1683,8 +1683,9 @@ static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, return 1; } -static inline void ieee80211_sta_ps(struct ieee80211_device *ieee) +static inline void ieee80211_sta_ps(unsigned long data) { + struct ieee80211_device *ieee = (struct ieee80211_device *)data; u32 th, tl; short sleep; @@ -2593,9 +2594,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee) spin_lock_init(&ieee->mgmt_tx_lock); spin_lock_init(&ieee->beacon_lock); - tasklet_init(&ieee->ps_task, - (void(*)(unsigned long)) ieee80211_sta_ps, - (unsigned long)ieee); + tasklet_init(&ieee->ps_task, ieee80211_sta_ps, (unsigned long)ieee); } void ieee80211_softmac_free(struct ieee80211_device *ieee) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 48f1591ed5b4..7e2cabd16e88 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2193,7 +2193,7 @@ static void rtl8192_init_priv_lock(struct r8192_priv *priv) static void rtl819x_watchdog_wqcallback(struct work_struct *work); -static void rtl8192_irq_rx_tasklet(struct r8192_priv *priv); +static void rtl8192_irq_rx_tasklet(unsigned long data); /* init tasklet and wait_queue here. only 2.6 above kernel is considered */ #define DRV_NAME "wlan0" static void rtl8192_init_priv_task(struct net_device *dev) @@ -2214,8 +2214,7 @@ static void rtl8192_init_priv_task(struct net_device *dev) InitialGainOperateWorkItemCallBack); INIT_WORK(&priv->qos_activate, rtl8192_qos_activate); - tasklet_init(&priv->irq_rx_tasklet, - (void(*)(unsigned long))rtl8192_irq_rx_tasklet, + tasklet_init(&priv->irq_rx_tasklet, rtl8192_irq_rx_tasklet, (unsigned long)priv); } @@ -4655,8 +4654,9 @@ static void rtl8192_rx_cmd(struct sk_buff *skb) } } -static void rtl8192_irq_rx_tasklet(struct r8192_priv *priv) +static void rtl8192_irq_rx_tasklet(unsigned long data) { + struct r8192_priv *priv = (struct r8192_priv *)data; struct sk_buff *skb; struct rtl8192_rx_info *info; |