[PATCH] nvme: initialize identify ns data to NULL

Kanchan Joshi joshi.k at samsung.com
Tue Mar 26 07:02:38 PDT 2024


On 3/26/2024 7:08 PM, Tokunori Ikegami wrote:
> 
> On 2024/03/26 17:50, Kanchan Joshi wrote:
>> On 3/25/2024 9:15 PM, Tokunori Ikegami wrote:
>>> Currently nvme_identify_ns() sets the data to NULL if failed.
>>> Also the data is not freed if the function returned failure.
>> If it fails, it frees the allocated memory too.
>> So I don't see how the patch helps.
> Yes I think this just helps if in future thenvme_identify_ns() function 
> or the caller functions changed the implementation.

Not a compelling case of future convenience, IMHO.

In the current scheme of things, the assignment to NULL in all the 
callers of nvme_identify_ns (there are few more than what this patch 
covered) is redundant.



More information about the Linux-nvme mailing list