Re: [PATCH] xfs: fix memory leak in xfs_dir2_node_removename

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

 



On 09/27/13 14:36, Roger Willcocks wrote:

On Fri, 2013-09-27 at 08:01 -0500, Mark Tinguely wrote:
plain text document attachment
(xfs-fix-leak-in-xfs_dir2_node_removename.patch)
Free the memory pointed to by state before returning on error from
xfs_dir2_node_removename.c

Signed-off-by: Mark Tinguely<tinguely@xxxxxxx>
---
Found by Coverity (134681) in userspace, same patch applies there
also.


Is the first hunk right ?

xfs_da_node_lookup_int called as

         error = xfs_da_node_lookup_int(state,&rval);

and returns with

         *result = retval;
         return(0);

so, on return, error == 0 and rval == an error code. The next lines:

         if (error)
                 rval = error;

won't change that. But previously if rval != EEXIST you returned rval.
With the change below, you return error, which is zero.

--
Roger


Thanks, guilty as charged. need to add the error = EEXIST.

--Mark.

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




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

  Powered by Linux