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 5c5c4b7..fbfe79a 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;
 }
 
 /*=======================================================================