lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 Nov 2019 21:05:51 -0800
From:   Kees Cook <keescook@...omium.org>
To:     Phong Tran <tranmanphong@...il.com>
Cc:     Larry.Finger@...inger.net, jakub.kicinski@...ronome.com,
        kvalo@...eaurora.org, Wright.Feng@...ress.com,
        arend.vanspriel@...adcom.com, davem@...emloft.net,
        emmanuel.grumbach@...el.com, franky.lin@...adcom.com,
        johannes.berg@...el.com, linux-kernel@...r.kernel.org,
        linux-wireless@...r.kernel.org, luciano.coelho@...el.com,
        netdev@...r.kernel.org, p.figiel@...lintechnologies.com,
        pieter-paul.giesberts@...adcom.com, pkshih@...ltek.com,
        rafal@...ecki.pl, sara.sharon@...el.com,
        shahar.s.matityahu@...el.com, yhchuang@...ltek.com,
        yuehaibing@...wei.com
Subject: Re: [Patch v2 4/4] rtlwifi: rtl_pci: Fix -Wcast-function-type

On Wed, Nov 27, 2019 at 12:55:29AM +0700, Phong Tran wrote:
> correct usage prototype of callback in tasklet_init().
> Report by https://github.com/KSPP/linux/issues/20
> 
> Signed-off-by: Phong Tran <tranmanphong@...il.com>

Reviewed-by: Kees Cook <keescook@...omium.org>

-Kees

> ---
>  drivers/net/wireless/realtek/rtlwifi/pci.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index f88d26535978..25335bd2873b 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -1061,13 +1061,15 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
>  	return ret;
>  }
>  
> -static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw)
> +static void _rtl_pci_irq_tasklet(unsigned long data)
>  {
> +	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
>  	_rtl_pci_tx_chk_waitq(hw);
>  }
>  
> -static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
> +static void _rtl_pci_prepare_bcn_tasklet(unsigned long data)
>  {
> +	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>  	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
>  	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
> @@ -1193,10 +1195,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,
>  
>  	/*task */
>  	tasklet_init(&rtlpriv->works.irq_tasklet,
> -		     (void (*)(unsigned long))_rtl_pci_irq_tasklet,
> +		     _rtl_pci_irq_tasklet,
>  		     (unsigned long)hw);
>  	tasklet_init(&rtlpriv->works.irq_prepare_bcn_tasklet,
> -		     (void (*)(unsigned long))_rtl_pci_prepare_bcn_tasklet,
> +		     _rtl_pci_prepare_bcn_tasklet,
>  		     (unsigned long)hw);
>  	INIT_WORK(&rtlpriv->works.lps_change_work,
>  		  rtl_lps_change_work_callback);
> -- 
> 2.20.1
> 

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ