From: Evgeniy Ivanov Date: Fri, 12 Aug 2011 17:40:52 +0000 (+0400) Subject: Add missing put_inode(). X-Git-Tag: v3.2.0~366 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.rndc.html?a=commitdiff_plain;h=426cddbb30a01d3053585676aafdaee29a830423;p=minix.git Add missing put_inode(). Fixes bug from a9a45cddc. --- diff --git a/servers/mfs/link.c b/servers/mfs/link.c index 07ae0a81d..c80b19b4f 100644 --- a/servers/mfs/link.c +++ b/servers/mfs/link.c @@ -321,8 +321,11 @@ PUBLIC int fs_rename() old_ip = NULL; if (r == EENTERMOUNT) r = EXDEV; /* should this fail at all? */ else if (r == ELEAVEMOUNT) r = EINVAL; /* rename on dot-dot */ - } else if (old_ip == NULL) { - return(err_code); + } + + if (old_ip == NULL) { + put_inode(old_dirp); + return(r); } /* Get new dir inode */ @@ -349,10 +352,7 @@ PUBLIC int fs_rename() r = EBUSY; } - if(old_ip != NULL) - odir = ((old_ip->i_mode & I_TYPE) == I_DIRECTORY); /* TRUE iff dir */ - else - odir = FALSE; + odir = ((old_ip->i_mode & I_TYPE) == I_DIRECTORY); /* TRUE iff dir */ /* If it is ok, check for a variety of possible errors. */ if(r == OK) {