浏览代码

serial: sunhv: Free memory when remove() is called

In each call to hv_remove(), con_read_page and con_write_page is not
getting freed and lead to memory leakage. Fix this by freeing both
pointers in hv_remove().

Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Souptick Joarder 8 年之前
父节点
当前提交
fbb7d2e3a9
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/tty/serial/sunhv.c

+ 2 - 1
drivers/tty/serial/sunhv.c

@@ -598,7 +598,8 @@ static int hv_remove(struct platform_device *dev)
 	uart_remove_one_port(&sunhv_reg, port);
 	uart_remove_one_port(&sunhv_reg, port);
 
 
 	sunserial_unregister_minors(&sunhv_reg, 1);
 	sunserial_unregister_minors(&sunhv_reg, 1);
-
+	kfree(con_read_page);
+	kfree(con_write_page);
 	kfree(port);
 	kfree(port);
 	sunhv_port = NULL;
 	sunhv_port = NULL;