diff mbox

Btrfs - Fix memory leak in btrfs_init_new_device()

Message ID 20110206195821.GA14978@kwango.lan.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ilya Dryomov Feb. 6, 2011, 7:58 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d158530..9649cdd 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1601,6 +1601,7 @@  int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
 
 	ret = find_next_devid(root, &device->devid);
 	if (ret) {
+		kfree(device->name);
 		kfree(device);
 		goto error;
 	}