linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.de>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: fix leak in qgroup_subtree_accounting() error path
Date: Mon, 18 Aug 2014 14:42:01 -0700	[thread overview]
Message-ID: <20140818214201.GC2203@wotan.suse.de> (raw)
In-Reply-To: <53F10BF1.6070602@redhat.com>

On Sun, Aug 17, 2014 at 03:09:21PM -0500, Eric Sandeen wrote:
> Coverity pointed this out; in the newly added
> qgroup_subtree_accounting(), if btrfs_find_all_roots()
> returns an error, we leak at least the parents pointer,
> and possibly the roots pointer, depending on what failure
> occurs.
> 
> If btrfs_find_all_roots() returns an error, we need to
> free up all allocations before we return.  "roots" is
> initialized to NULL, so it should be safe to free
> it unconditionally (ulist_free() handles that case).

Great, thanks for this Eric.

Reviewed-by: Mark Fasheh <mfasheh@suse.de>

--
Mark Fasheh

  parent reply	other threads:[~2014-08-18 21:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 20:09 [PATCH] btrfs: fix leak in qgroup_subtree_accounting() error path Eric Sandeen
2014-08-17 20:25 ` Eric Sandeen
2014-08-18 21:42 ` Mark Fasheh [this message]
2014-08-19 15:27   ` Chris Mason

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=20140818214201.GC2203@wotan.suse.de \
    --to=mfasheh@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).