Btrfs: fix use-after-free in __btrfs_end_transaction
authorDave Jones <davej@redhat.com>
Thu, 12 Apr 2012 20:03:56 +0000 (16:03 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 12 Apr 2012 20:03:56 +0000 (16:03 -0400)
commit4edc2ca388d62abffe38149f6ac00e749ea721c5
tree6e31a2d72b9bb05f46960c0a8a789044f5dcf584
parente627ee7bcd42b4e3a03ca01a8e46dcb4033c5ae0
Btrfs: fix use-after-free in __btrfs_end_transaction

49b25e0540904be0bf558b84475c69d72e4de66e introduced a use-after-free bug
that caused spurious -EIO's to be returned.

Do the check before we free the transaction.

Cc: David Sterba <dsterba@suse.cz>
Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/transaction.c