Search Linux Wireless

Re: [PATCH] lib80211: Use ERR_CAST() to return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 06, 2024 at 05:14:55PM +0530, Rohit Chavan wrote:
> Using ERR_CAST() is more reasonable and safer, When it is necessary
> to convert the type of an error pointer and return it.
> 
> Signed-off-by: Rohit Chavan <roheetchavan@xxxxxxxxx>
> ---
>  net/wireless/lib80211.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c
> index d66a913027e0..87c0e09aa676 100644
> --- a/net/wireless/lib80211.c
> +++ b/net/wireless/lib80211.c
> @@ -227,7 +227,7 @@ EXPORT_SYMBOL(lib80211_get_crypto_ops);
>  
>  static void *lib80211_crypt_null_init(int keyidx)
>  {
> -	return (void *)1;
> +	return ERR_CAST(1);

This seems wrong to me. ERR_CAST is designed to cast a pointer
to an error pointer. But 1 is an integer, not a pointer.

>  }
>  
>  static void lib80211_crypt_null_deinit(void *priv)
> -- 
> 2.34.1
> 
> 




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux