From: Souptick Joarder Date: Mon, 14 Nov 2016 12:14:49 +0000 (+0530) Subject: serial: sunsu: Free memory when probe fails X-Git-Tag: v4.10-rc1~149^2~11 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=af6f9d6883ac95d14271b4613e5813f2938dd4d4;p=karo-tx-linux.git 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 Signed-off-by: Greg Kroah-Hartman --- 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) out_unmap: of_iounmap(&op->resource[0], up->port.membase, up->reg_size); + kfree(up); return err; }