[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190923223437.11086-1-navid.emamdoost@gmail.com>
Date: Mon, 23 Sep 2019 17:34:36 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: emamd001@....edu, smccaman@....edu, kjlu@....edu,
Navid Emamdoost <navid.emamdoost@...il.com>,
Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>, linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] btrfs: prevent memory leak
In btrfsic_mount if btrfsic_dev_state_alloc fails the allocated state
will be leaked. It needs to be released on error handling path.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
fs/btrfs/check-integrity.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index 0b52ab4cb964..8a77b0cb2db3 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -2941,6 +2941,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info,
if (NULL == ds) {
pr_info("btrfs check-integrity: kmalloc() failed!\n");
mutex_unlock(&btrfsic_mutex);
+ kvfree(state);
return -ENOMEM;
}
ds->bdev = device->bdev;
--
2.17.1
Powered by blists - more mailing lists