Re: [PATCH] Btrfs-progs: Add missing free() against fs_info->super_copy

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

 



On Mon, May 27, 2013 at 1:12 PM, David Sterba <dsterba@xxxxxxx> wrote:
> Hi,
>
> please don't forget to mention what changed in a revised version

Yeah, sorry, it was my first usage of git send-email (as described in the wiki).

>
> On Sat, May 25, 2013 at 03:16:39PM +0100, Filipe David Borba Manana wrote:
>> @@ -228,6 +227,8 @@ out:
>>       free(chunk_root);
>>       free(dev_root);
>>       free(csum_root);
>> +     if (fs_info)
>> +             free(fs_info->super_copy);
>
> free accepts NULL pointers and does nothing, so it's fine to do it as in
> the first version.

Right. Just thought it was better to check if the calloc() for fs_info
succeeded before derreferencing it for free'ing its super_copy member
(the function's code doesn't check if any of the malloc() / calloc()
calls returned non-NULL, so it wouldn't be inconsistent with the
existing code)

>
>>       free(fs_info);
>>       return NULL;
>
> otherwise ok. Thanks.

Thanks for review and advise.
Do you need more action from my side?

>
> david



--
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux