OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1957de9
)
usb: typec: tcpm: free log buf memory when remove debug file
author
Li Jun
<jun.li@nxp.com>
Wed, 17 Jul 2019 08:06:45 +0000
(16:06 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 30 Jul 2019 09:04:09 +0000
(11:04 +0200)
The logbuffer memory should be freed when remove debug file.
Cc: stable@vger.kernel.org # v4.15+
Fixes:
4b4e02c83167
("typec: tcpm: Move out of staging")
Signed-off-by: Li Jun <jun.li@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link:
https://lore.kernel.org/r/20190717080646.30421-1-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c
patch
|
blob
|
history
diff --git
a/drivers/usb/typec/tcpm/tcpm.c
b/drivers/usb/typec/tcpm/tcpm.c
index
77f71f6
..
7b6497c
100644
(file)
--- a/
drivers/usb/typec/tcpm/tcpm.c
+++ b/
drivers/usb/typec/tcpm/tcpm.c
@@
-587,6
+587,15
@@
static void tcpm_debugfs_init(struct tcpm_port *port)
static void tcpm_debugfs_exit(struct tcpm_port *port)
{
+ int i;
+
+ mutex_lock(&port->logbuffer_lock);
+ for (i = 0; i < LOG_BUFFER_ENTRIES; i++) {
+ kfree(port->logbuffer[i]);
+ port->logbuffer[i] = NULL;
+ }
+ mutex_unlock(&port->logbuffer_lock);
+
debugfs_remove(port->dentry);
}