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]
Message-ID: <1207e17b-7a32-42b1-8047-b01e221ab3a9@kernel.dk>
Date: Sun, 11 Aug 2024 16:31:23 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Thorsten Blum <thorsten.blum@...lux.com>, asml.silence@...il.com
Cc: io-uring@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring/net: Remove unneeded if check in
 io_net_vec_assign()

On 8/11/24 4:26 PM, Thorsten Blum wrote:
> kfree() already checks if its argument is NULL. Remove the unneeded if
> check and fix the following Coccinelle/coccicheck warning reported by
> ifnullfree.cocci:
> 
>   WARNING: NULL check before some freeing functions is not needed

Yes it's not needed, but the NULL check is done after a function call.
For the hot path, it's FASTER to check if it's NULL or not.

I can put a comment on these, but honestly I wish the ifnullfree
thing would just go away as it's hardly useful for anything. It's
not like it's a bug to check for NULL first, or that it would find
something useful.

-- 
Jens Axboe



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ