lkml.org 
[lkml]   [2021]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mwifiex: avoid null-pointer-subtraction warning
Date
Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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@arndb.de>

I'll queue this to v5.15.

--
https://patchwork.kernel.org/project/linux-wireless/list/

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

\
 
 \ /
  Last update: 2021-09-28 08:45    [W:2.161 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site