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:  dereferencing freed memory
Date: Thu, 26 Mar 2009 16:42:48 +0300 (EAT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0903261641070.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/async-thread.c	2009-03-26 16:36:46.000000000 +0300
+++ devel/fs/btrfs/async-thread.c	2009-03-26 16:39:08.000000000 +0300
@@ -278,8 +278,8 @@
 					   workers->num_workers + i);
 		worker->workers = workers;
 		if (IS_ERR(worker->task)) {
-			kfree(worker);
 			ret = PTR_ERR(worker->task);
+			kfree(worker);
 			goto fail;
 		}
 

  reply	other threads:[~2009-03-26 13:42 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 ` Dan Carpenter [this message]
2009-03-26 13:45 ` btrfs: returning under lock Dan Carpenter
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.0903261641070.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