Search Linux Wireless

Re: [PATCH] mwifiex: avoid null-pointer-subtraction warning

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

 



Arnd Bergmann <arnd@xxxxxxxxxx> wrote:

> From: Arnd Bergmann <arnd@xxxxxxxx>
> 
> clang complains about some NULL pointer arithmetic in this driver:
> 
> drivers/net/wireless/marvell/mwifiex/sta_tx.c:65:59: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
>         pad = ((void *)skb->data - (sizeof(*local_tx_pd) + hroom)-
>                                                                  ^
> drivers/net/wireless/marvell/mwifiex/uap_txrx.c:478:53: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
>         pad = ((void *)skb->data - (sizeof(*txpd) + hroom) - NULL) &
> 
> Rework that expression to do the same thing using a uintptr_t.
> 
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Patch applied to wireless-drivers.git, thanks.

603a1621caa0 mwifiex: avoid null-pointer-subtraction warning

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210927121656.940304-1-arnd@xxxxxxxxxx/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches




[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