diff options
author | Souptick Joarder <jrdr.linux@gmail.com> | 2016-11-14 07:14:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-11-16 04:57:26 -0500 |
commit | af6f9d6883ac95d14271b4613e5813f2938dd4d4 (patch) | |
tree | dde2f4c703fb6ff164c97831b75d82a69f844235 | |
parent | fbb7d2e3a9cc07dd56a9c4d337352b3b1cb34c89 (diff) |
serial: sunsu: Free memory when probe fails
When su_probe() fails it doesn't free *up and we may have a memory
leak. Fix this by freeing *up before return.
Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/sunsu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 9ad98eaa35bf..72df2e1b88af 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c | |||
@@ -1500,6 +1500,7 @@ static int su_probe(struct platform_device *op) | |||
1500 | 1500 | ||
1501 | out_unmap: | 1501 | out_unmap: |
1502 | of_iounmap(&op->resource[0], up->port.membase, up->reg_size); | 1502 | of_iounmap(&op->resource[0], up->port.membase, up->reg_size); |
1503 | kfree(up); | ||
1503 | return err; | 1504 | return err; |
1504 | } | 1505 | } |
1505 | 1506 | ||