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] [day] [month] [year] [list]
Message-Id: <20210615104240.57EF3C433F1@smtp.codeaurora.org>
Date:   Tue, 15 Jun 2021 10:42:40 +0000 (UTC)
From:   Kalle Valo <kvalo@...eaurora.org>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Arend van Spriel <aspriel@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        linux-wireless@...r.kernel.org,
        brcm80211-dev-list.pdl@...adcom.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Guenter Roeck <linux@...ck-us.net>
Subject: Re: brcmsmac: Drop unnecessary NULL check after container_of

Guenter Roeck <linux@...ck-us.net> wrote:

> The parameter passed to ai_detach() is guaranteed to never be NULL
> because it is checked by the caller. Consequently, the result of
> container_of() on it is also never NULL, and a NULL check on it
> is unnecessary. Even without that, the NULL check would still be
> unnecessary because the subsequent kfree() can handle NULL arguments.
> On top of all that, it is misleading to check the result of container_of()
> against NULL because the position of the contained element could change,
> which would make the check invalid. Remove it.
> 
> This change was made automatically with the following Coccinelle script.
> 
> @@
> type t;
> identifier v;
> statement s;
> @@
> 
> <+...
> (
>   t v = container_of(...);
> |
>   v = container_of(...);
> )
>   ...
>   when != v
> - if (\( !v \| v == NULL \) ) s
> ...+>
> 
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>

Patch applied to wireless-drivers-next.git, thanks.

34fe7038a3b3 brcmsmac: Drop unnecessary NULL check after container_of

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210511235629.1686038-1-linux@roeck-us.net/

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ