From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@redhat.com>,
dm-devel@redhat.com, Neil Brown <neilb@suse.com>
Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] dm: ioctl: prevent double freeing
Date: Fri, 4 Sep 2015 16:52:39 +0530 [thread overview]
Message-ID: <1441365759-7247-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
DM_PARAMS_KMALLOC and DM_PARAMS_VMALLOC should never be set together in
param_flags. We are setting these flags while allocating so we know that
there is almost no chance of having these two set together but still we
can have some additional safety.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/md/dm-ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 80a4395..aaad74e 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1680,7 +1680,7 @@ static void free_params(struct dm_ioctl *param, size_t param_size, int param_fla
if (param_flags & DM_PARAMS_KMALLOC)
kfree(param);
- if (param_flags & DM_PARAMS_VMALLOC)
+ else if (param_flags & DM_PARAMS_VMALLOC)
vfree(param);
}
--
1.9.1
next reply other threads:[~2015-09-04 11:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 11:22 Sudip Mukherjee [this message]
2015-09-15 7:53 ` [PATCH] dm: ioctl: prevent double freeing Sudip Mukherjee
2015-09-15 16:18 ` [dm-devel] " Darrick J. Wong
2015-09-15 18:13 ` Mike Snitzer
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=1441365759-7247-1-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.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;
as well as URLs for NNTP newsgroup(s).