On Tue, Sep 08, 2015 at 05:02:32PM +0800, Sheng Yong wrote:
> Hi, Qu
> 
> On 9/8/2015 4:50 PM, Qu Wenruo wrote:
> > Sheng Yong wrote on 2015/09/08 08:46 +0000:
> >> * If the allocation failed, don't free to free it, even though kfree
> >>    allows to free a NULL pointer.
> >> * If posix_acl_to_xattr() failed, cleanup the allocation and return
> >>    the error directly.
> > So, what's the point?
> > For me, I didn't see the pros of the change.
> > As kfree() allow NULL pointer, why not use it?
> In fact, there is no semantic changes. It's just because when I walk through
> the code, and find there is no need to call kfree(), and could be cleaned up.
> It's fine to keep as it is :)

I agree with Qu. In this case it's not performance critical and conforms
to the widely used pattern of single return point from branches.
However, the acl functions are not consistent in that respect. It's more
a matter of style that gets unified eventually.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to