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/rtl8712/rtl8712_recv.c | |
parent | 2611045e3555cd0d75837ae69ffd70ef51e28bf7 (diff) | |
download | linux-6cfed598480493d814414ce7e53027bd6fc45c49.tar.bz2 |
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/rtl8712/rtl8712_recv.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl8712_recv.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 06de031be6a9..00ea0beb12c9 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -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))) { |