Commit af6f9d68 authored by Souptick Joarder's avatar Souptick Joarder Committed by Greg Kroah-Hartman

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: default avatarSouptick joarder <jrdr.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fbb7d2e3
...@@ -1500,6 +1500,7 @@ static int su_probe(struct platform_device *op) ...@@ -1500,6 +1500,7 @@ static int su_probe(struct platform_device *op)
out_unmap: out_unmap:
of_iounmap(&op->resource[0], up->port.membase, up->reg_size); of_iounmap(&op->resource[0], up->port.membase, up->reg_size);
kfree(up);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment