aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorJ Freyensee <james_p_freyensee@linux.intel.com>2011-05-25 14:38:18 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-07 10:01:18 -0700
commit29021bccea0dc42d7d101004058438a9a4e693b1 (patch)
tree134ae622ea3bab6a08c9b9684b1ee46ba55942ad /drivers/misc
parent9d031d94da453077bbc6108b7822fc751ac85299 (diff)
pti: double-free security PTI fix
This patch fixes a double-free error that will not always be seen unless /dev/pti char interface is stressed. Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/pti.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index bb6f9255c17..be4857358d9 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -317,7 +317,8 @@ EXPORT_SYMBOL_GPL(pti_request_masterchannel);
* a master, channel ID address
* used to write to PTI HW.
*
- * @mc: master, channel apeture ID address to be released.
+ * @mc: master, channel apeture ID address to be released. This
+ * will de-allocate the structure via kfree().
*/
void pti_release_masterchannel(struct pti_masterchannel *mc)
{
@@ -581,7 +582,7 @@ static int pti_char_open(struct inode *inode, struct file *filp)
static int pti_char_release(struct inode *inode, struct file *filp)
{
pti_release_masterchannel(filp->private_data);
- kfree(filp->private_data);
+ filp->private_data = NULL;
return 0;
}