mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
usb: typec: tcpm: free log buf memory when remove debug file
commitfd5da3e2ccupstream. The logbuffer memory should be freed when remove debug file. Cc: stable@vger.kernel.org # v4.15+ Fixes:4b4e02c831("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ad9b592910
commit
ba2bf3bad7
@@ -586,6 +586,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user