public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Eric Van Hensbergen <ericvh@gmail.com>
Cc: rminnich@lanl.gov, lucho@ionkov.net,
	v9fs-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [2.6.20 patch] v9fs_vfs_mkdir(): fix a double free
Date: Fri, 2 Feb 2007 17:56:05 +0100	[thread overview]
Message-ID: <20070202165605.GI3754@stusta.de> (raw)

This patch fixes a double free of "dfid" introduced by
commit da977b2c7eb4d6312f063a7b486f2aad99809710 and spotted by the 
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.20-rc6-mm3/fs/9p/vfs_inode.c.old	2007-02-02 17:11:10.000000000 +0100
+++ linux-2.6.20-rc6-mm3/fs/9p/vfs_inode.c	2007-02-02 17:39:12.000000000 +0100
@@ -583,21 +583,18 @@ static int v9fs_vfs_mkdir(struct inode *
 	v9fs_fid_clunk(v9ses, dfid);
 	inode = v9fs_inode_from_fid(v9ses, vfid->fid, dir->i_sb);
 	if (IS_ERR(inode)) {
 		err = PTR_ERR(inode);
 		inode = NULL;
-		goto clean_up_fids;
+		v9fs_fid_destroy(vfid);
+		goto error;
 	}
 
 	dentry->d_op = &v9fs_dentry_operations;
 	d_instantiate(dentry, inode);
 	return 0;
 
-clean_up_fids:
-	if (vfid)
-		v9fs_fid_destroy(vfid);
-
 clean_up_dfid:
 	v9fs_fid_clunk(v9ses, dfid);
 
 error:
 	return err;

                 reply	other threads:[~2007-02-02 16:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070202165605.GI3754@stusta.de \
    --to=bunk@stusta.de \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=rminnich@lanl.gov \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox