Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1245673 > unrolled thread

[PATCH] dm snapshot: fix memory leak in error path

Started byMichael Opdenacker <michael.opdenacker@free-electrons.com>
First post2015-10-13 14:40 +0200
Last post2015-10-13 14:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] dm snapshot: fix memory leak in error path Michael Opdenacker <michael.opdenacker@free-electrons.com> - 2015-10-13 14:40 +0200

#1245673 — [PATCH] dm snapshot: fix memory leak in error path

FromMichael Opdenacker <michael.opdenacker@free-electrons.com>
Date2015-10-13 14:40 +0200
Subject[PATCH] dm snapshot: fix memory leak in error path
Message-ID<qj722-6Fq-27@gated-at.bofh.it>
Fix a memory leak in an error path (reported by Coverity CID 1326059)
Also add a missing workqueue deallocation in the same error path.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
 drivers/md/dm-snap-persistent.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index aeacad9be51d..1e980fa8bb8b 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -879,6 +879,8 @@ static int persistent_ctr(struct dm_exception_store *store, char *options)
 			store->userspace_supports_overflow = true;
 		else {
 			DMERR("Unsupported persistent store option: %s", options);
+			destroy_workqueue(ps->metadata_wq);
+			kfree(ps);
 			return -EINVAL;
 		}
 	}
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web