From: Michael Opdenacker <michael.opdenacker@free-electrons.com>
To: agk@redhat.com, snitzer@redhat.com
Cc: dm-devel@redhat.com, neilb@suse.com, linux-raid@vger.kernel.org,
linux-kernel@vger.kernel.org,
Michael Opdenacker <michael.opdenacker@free-electrons.com>
Subject: [PATCH] dm snapshot: fix memory leak in error path
Date: Tue, 13 Oct 2015 14:36:38 +0200 [thread overview]
Message-ID: <1444739798-21892-1-git-send-email-michael.opdenacker@free-electrons.com> (raw)
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
reply other threads:[~2015-10-13 12:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1444739798-21892-1-git-send-email-michael.opdenacker@free-electrons.com \
--to=michael.opdenacker@free-electrons.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=snitzer@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
all inboxes | Powered by JetHome®