Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: chris.mason@oracle.com
Cc: linux-btrfs@vger.kernel.org
Subject: btrfs:  returning under lock
Date: Thu, 26 Mar 2009 16:45:26 +0300 (EAT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0903261643560.31773@usbsys.site> (raw)
In-Reply-To: <Pine.LNX.4.64.0903261633260.31773@usbsys.site>

This was found by smatch (http://repo.or.cz/w/smatch.git/)

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/fs/btrfs/transaction.c	2009-03-26 16:25:37.000000000 +0300
+++ devel/fs/btrfs/transaction.c	2009-03-26 16:26:36.000000000 +0300
@@ -914,8 +914,10 @@
 	}
 
 	pinned_copy = kmalloc(sizeof(*pinned_copy), GFP_NOFS);
-	if (!pinned_copy)
+	if (!pinned_copy) {
+		mutex_unlock(&root->fs_info->trans_mutex);
 		return -ENOMEM;
+	}
 
 	extent_io_tree_init(pinned_copy,
 			     root->fs_info->btree_inode->i_mapping, GFP_NOFS);

  parent reply	other threads:[~2009-03-26 13:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 13:39 btrfs: memory leak on error path error27
2009-03-26 13:42 ` btrfs: dereferencing freed memory Dan Carpenter
2009-03-26 13:45 ` Dan Carpenter [this message]
2009-03-26 13:54 ` unhandled kmallocs remaining Dan Carpenter
2009-03-26 14:04   ` btrfs: [patch] remove dead code Dan Carpenter
2009-03-26 14:10   ` [patch] btrfs: " Dan Carpenter
2009-03-26 14:20   ` [patch] btrfs: remove dead code #3 Dan Carpenter
2009-03-26 14:39     ` Jens Axboe
2009-03-26 14:48       ` Chris Mason
2009-03-26 15:43         ` Jens Axboe
2009-03-26 23:30           ` linux-2.6.29: BUG at fs/btrfs/extent-tree.c:3433 Matteo Frigo

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=Pine.LNX.4.64.0903261643560.31773@usbsys.site \
    --to=error27@gmail.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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