Re: [PATCH] scsi: ses: Move a label in ses_enclosure_data_process()

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

 



On Thu, 2023-12-28 at 15:48 +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Date: Thu, 28 Dec 2023 15:38:09 +0100
> 
> The kfree() function was called in up to three cases by
> the ses_enclosure_data_process() function during error handling
> even if the passed variable contained a null pointer.
> This issue was detected by using the Coccinelle software.

Why is this an issue?  The whole point of having kfree(NULL) be a nop
is so we don't have to special case the free path.  The reason we do
that is because multiple special case paths through code leads to more
complex control flows and more potential bugs.  If coccinelle suddenly
thinks this is a problem, it's coccinelle that needs fixing.

James





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux