Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: mxs-auart: put the device in the error path

The mxs_auart_probe() gets the device by the get_device().
So we should put the device in the error path to balance the
device's reference counter.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Huang Shijie and committed by
Greg Kroah-Hartman
23666a74 cdd86b27

+1
+1
drivers/tty/serial/mxs-auart.c
··· 781 781 auart_port[pdev->id] = NULL; 782 782 free_irq(s->irq, s); 783 783 out_free_clk: 784 + put_device(s->dev); 784 785 clk_put(s->clk); 785 786 out_free: 786 787 kfree(s);