]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: dgnc: free memory allocated
authorHari Prasath Gujulan Elango <hgujulan@visteon.com>
Thu, 18 Jun 2015 13:27:28 +0000 (13:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Jun 2015 04:15:17 +0000 (21:15 -0700)
The memory allocated in dgnc_tty_register() for two objects is not freed
anywhere.This patch addresses this by freeing the memory in
dgnc_tty_uninit.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c

index 5c5c4b77425668b36a2b5e64fc7d1a2055c49a63..fbfe79a70263a7c81d3059359243395ca77257f5 100644 (file)
@@ -422,8 +422,12 @@ void dgnc_tty_uninit(struct dgnc_board *brd)
 
        kfree(brd->SerialDriver.ttys);
        brd->SerialDriver.ttys = NULL;
+       kfree(brd->SerialDriver.termios);
+       brd->SerialDriver.termios = NULL;
        kfree(brd->PrintDriver.ttys);
        brd->PrintDriver.ttys = NULL;
+       kfree(brd->PrintDriver.termios);
+       brd->PrintDriver.termios = NULL;
 }
 
 /*=======================================================================