Re: [PATCH RFC] libtracefs: Improve exception handling in instance_alloc()

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

 



On Fri, 10 Mar 2023 17:30:22 +0100
Markus Elfring <Markus.Elfring@xxxxxx> wrote:

> Hello,
> 
> I hope that the following information sources can be taken better into account.
> 
> * Centralized exiting of functions
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.3-rc1#n526
> 
> * MEM12-C: Consider using a goto chain when leaving a function on error when using and releasing resources
>   https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources#MEM12C.Considerusingagotochainwhenleavingafunctiononerrorwhenusingandreleasingresources-CompliantSolution%28POSIX,GotoChain%29
> 
> 
> How will the chances evolve to integrate the attached change suggestion?
> 

Everything is initialized to NULL, and free(NULL) is perfectly acceptable.
Why complicate the code with more labels than needed?

So no, I will not consider this change.

-- Steve




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux