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>
This commit is contained in:
Родитель
2611045e35
Коммит
6cfed59848
|
@ -22,8 +22,7 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
|
|||
int i, res = _SUCCESS;
|
||||
struct recv_buf *precvbuf;
|
||||
|
||||
tasklet_init(&precvpriv->recv_tasklet,
|
||||
(void(*)(unsigned long))rtl8188eu_recv_tasklet,
|
||||
tasklet_init(&precvpriv->recv_tasklet, rtl8188eu_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
|
||||
/* init recv_buf */
|
||||
|
|
|
@ -17,8 +17,7 @@ s32 rtw_hal_init_xmit_priv(struct adapter *adapt)
|
|||
{
|
||||
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
|
||||
|
||||
tasklet_init(&pxmitpriv->xmit_tasklet,
|
||||
(void(*)(unsigned long))rtl8188eu_xmit_tasklet,
|
||||
tasklet_init(&pxmitpriv->xmit_tasklet, rtl8188eu_xmit_tasklet,
|
||||
(unsigned long)adapt);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ enum rx_packet_type {
|
|||
};
|
||||
|
||||
#define INTERRUPT_MSG_FORMAT_LEN 60
|
||||
void rtl8188eu_recv_tasklet(void *priv);
|
||||
void rtl8188eu_recv_tasklet(unsigned long priv);
|
||||
void rtl8188e_process_phy_info(struct adapter *padapter,
|
||||
struct recv_frame *prframe);
|
||||
void update_recvframe_phyinfo_88e(struct recv_frame *fra, struct phy_stat *phy);
|
||||
|
|
|
@ -148,7 +148,7 @@ void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
|
|||
s32 rtl8188eu_init_xmit_priv(struct adapter *padapter);
|
||||
s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter);
|
||||
#define hal_xmit_handler rtl8188eu_xmit_buf_handler
|
||||
void rtl8188eu_xmit_tasklet(void *priv);
|
||||
void rtl8188eu_xmit_tasklet(unsigned long priv);
|
||||
bool rtl8188eu_xmitframe_complete(struct adapter *padapter,
|
||||
struct xmit_priv *pxmitpriv);
|
||||
|
||||
|
|
|
@ -773,10 +773,10 @@ void usb_write_port_cancel(struct adapter *padapter)
|
|||
}
|
||||
}
|
||||
|
||||
void rtl8188eu_recv_tasklet(void *priv)
|
||||
void rtl8188eu_recv_tasklet(unsigned long priv)
|
||||
{
|
||||
struct sk_buff *pskb;
|
||||
struct adapter *adapt = priv;
|
||||
struct adapter *adapt = (struct adapter *)priv;
|
||||
struct recv_priv *precvpriv = &adapt->recvpriv;
|
||||
|
||||
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
|
||||
|
@ -792,9 +792,9 @@ void rtl8188eu_recv_tasklet(void *priv)
|
|||
}
|
||||
}
|
||||
|
||||
void rtl8188eu_xmit_tasklet(void *priv)
|
||||
void rtl8188eu_xmit_tasklet(unsigned long priv)
|
||||
{
|
||||
struct adapter *adapt = priv;
|
||||
struct adapter *adapt = (struct adapter *)priv;
|
||||
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
|
||||
|
||||
if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY))
|
||||
|
|
|
@ -2044,8 +2044,9 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)
|
|||
|
||||
}
|
||||
|
||||
static inline void rtllib_sta_ps(struct rtllib_device *ieee)
|
||||
static inline void rtllib_sta_ps(unsigned long data)
|
||||
{
|
||||
struct rtllib_device *ieee = (struct rtllib_device *)data;
|
||||
u64 time;
|
||||
short sleep;
|
||||
unsigned long flags, flags2;
|
||||
|
@ -3027,9 +3028,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
|
|||
spin_lock_init(&ieee->mgmt_tx_lock);
|
||||
spin_lock_init(&ieee->beacon_lock);
|
||||
|
||||
tasklet_init(&ieee->ps_task,
|
||||
(void(*)(unsigned long)) rtllib_sta_ps,
|
||||
(unsigned long)ieee);
|
||||
tasklet_init(&ieee->ps_task, rtllib_sta_ps, (unsigned long)ieee);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static u8 bridge_tunnel_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8};
|
|||
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
|
||||
static u8 rfc1042_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
|
||||
|
||||
static void recv_tasklet(void *priv);
|
||||
static void recv_tasklet(unsigned long priv);
|
||||
|
||||
void r8712_init_recv_priv(struct recv_priv *precvpriv,
|
||||
struct _adapter *padapter)
|
||||
|
@ -65,8 +65,7 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv,
|
|||
precvbuf++;
|
||||
}
|
||||
precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
|
||||
tasklet_init(&precvpriv->recv_tasklet,
|
||||
(void(*)(unsigned long))recv_tasklet,
|
||||
tasklet_init(&precvpriv->recv_tasklet, recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
skb_queue_head_init(&precvpriv->rx_skb_queue);
|
||||
|
||||
|
@ -1078,10 +1077,10 @@ static void recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb)
|
|||
} while ((transfer_len > 0) && pkt_cnt > 0);
|
||||
}
|
||||
|
||||
static void recv_tasklet(void *priv)
|
||||
static void recv_tasklet(unsigned long priv)
|
||||
{
|
||||
struct sk_buff *pskb;
|
||||
struct _adapter *padapter = priv;
|
||||
struct _adapter *padapter = (struct _adapter *)priv;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
||||
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
|
||||
|
|
|
@ -143,9 +143,8 @@ int _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
|
|||
INIT_WORK(&padapter->wk_filter_rx_ff0, r8712_SetFilter);
|
||||
alloc_hwxmits(padapter);
|
||||
init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
|
||||
tasklet_init(&pxmitpriv->xmit_tasklet,
|
||||
(void(*)(unsigned long))r8712_xmit_bh,
|
||||
(unsigned long)padapter);
|
||||
tasklet_init(&pxmitpriv->xmit_tasklet, r8712_xmit_bh,
|
||||
(unsigned long)padapter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ int r8712_pre_xmit(struct _adapter *padapter, struct xmit_frame *pxmitframe);
|
|||
int r8712_xmit_enqueue(struct _adapter *padapter,
|
||||
struct xmit_frame *pxmitframe);
|
||||
void r8712_xmit_direct(struct _adapter *padapter, struct xmit_frame *pxmitframe);
|
||||
void r8712_xmit_bh(void *priv);
|
||||
void r8712_xmit_bh(unsigned long priv);
|
||||
|
||||
void xmitframe_xmitbuf_attach(struct xmit_frame *pxmitframe,
|
||||
struct xmit_buf *pxmitbuf);
|
||||
|
|
|
@ -308,10 +308,10 @@ void r8712_usb_read_port_cancel(struct _adapter *padapter)
|
|||
}
|
||||
}
|
||||
|
||||
void r8712_xmit_bh(void *priv)
|
||||
void r8712_xmit_bh(unsigned long priv)
|
||||
{
|
||||
int ret = false;
|
||||
struct _adapter *padapter = priv;
|
||||
struct _adapter *padapter = (struct _adapter *)priv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter->driver_stopped ||
|
||||
|
|
|
@ -230,7 +230,7 @@ static inline bool pkt_exceeds_tail(struct recv_priv *precvpriv,
|
|||
return false;
|
||||
}
|
||||
|
||||
static void rtl8723bs_recv_tasklet(void *priv)
|
||||
static void rtl8723bs_recv_tasklet(unsigned long priv)
|
||||
{
|
||||
struct adapter *padapter;
|
||||
struct hal_com_data *p_hal_data;
|
||||
|
@ -244,7 +244,7 @@ static void rtl8723bs_recv_tasklet(void *priv)
|
|||
_pkt *pkt_copy = NULL;
|
||||
u8 shift_sz = 0, rx_report_sz = 0;
|
||||
|
||||
padapter = priv;
|
||||
padapter = (struct adapter *)priv;
|
||||
p_hal_data = GET_HAL_DATA(padapter);
|
||||
precvpriv = &padapter->recvpriv;
|
||||
recv_buf_queue = &precvpriv->recv_buf_pending_queue;
|
||||
|
@ -462,11 +462,8 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
|
|||
goto initbuferror;
|
||||
|
||||
/* 3 2. init tasklet */
|
||||
tasklet_init(
|
||||
&precvpriv->recv_tasklet,
|
||||
(void(*)(unsigned long))rtl8723bs_recv_tasklet,
|
||||
(unsigned long)padapter
|
||||
);
|
||||
tasklet_init(&precvpriv->recv_tasklet, rtl8723bs_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
|
||||
goto exit;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче