From: Huang Shijie <b32955@freescale.com>
To: gregkh@linuxfoundation.org
Cc: alan@linux.intel.com, linux-serial@vger.kernel.org,
shawn.guo@linaro.org, Huang Shijie <b32955@freescale.com>
Subject: [PATCH] serial: mxs-auart: put the device in the error path
Date: Tue, 11 Sep 2012 15:30:30 +0800 [thread overview]
Message-ID: <1347348630-20329-1-git-send-email-b32955@freescale.com> (raw)
In-Reply-To: <20120910230005.GA15782@kroah.com>
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>
---
drivers/tty/serial/mxs-auart.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 6898413..6db3baa 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -781,6 +781,7 @@ out_free_irq:
auart_port[pdev->id] = NULL;
free_irq(s->irq, s);
out_free_clk:
+ put_device(s->dev);
clk_put(s->clk);
out_free:
kfree(s);
--
1.7.0.4
next prev parent reply other threads:[~2012-09-11 7:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 2:38 [PATCH 1/2] serial: mxs-auart: fix the wrong setting order Huang Shijie
2012-09-07 2:38 ` [PATCH 2/2] serial: mxs-auart: put the device in mxs_auart_probe() Huang Shijie
2012-09-07 2:43 ` Shawn Guo
2012-09-07 2:33 ` [PATCH] serial: mxs-auart: put the device when exit or error Huang Shijie
2012-09-07 3:14 ` Shawn Guo
2012-09-10 23:00 ` Greg KH
2012-09-11 7:30 ` Huang Shijie [this message]
2012-09-07 2:48 ` [PATCH 2/2] serial: mxs-auart: put the device in mxs_auart_probe() Huang Shijie
2012-09-07 2:38 ` [PATCH 1/2] serial: mxs-auart: fix the wrong setting order Shawn Guo
2012-09-07 2:43 ` Huang Shijie
2012-09-13 5:28 ` Lauri Hintsala
2012-09-13 5:45 ` Huang Shijie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347348630-20329-1-git-send-email-b32955@freescale.com \
--to=b32955@freescale.com \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
--cc=shawn.guo@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).