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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
fbb7d2e3a9
commit
af6f9d6883
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user