Skip to content

Commit

Permalink
serial: sunsu: Free memory when probe fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Souptick Joarder authored and Greg Kroah-Hartman committed Nov 16, 2016
1 parent fbb7d2e commit af6f9d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/tty/serial/sunsu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit af6f9d6

Please sign in to comment.