From: Huang Shijie <b32955@freescale.com>
To: <gregkh@linuxfoundation.org>
Cc: <alan@linux.intel.com>, <linux-serial@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <shawn.guo@linaro.org>,
Huang Shijie <b32955@freescale.com>
Subject: [PATCH] serial: mxs-auart: put the device when exit or error
Date: Fri, 7 Sep 2012 10:33:07 +0800 [thread overview]
Message-ID: <1346985187-30459-1-git-send-email-b32955@freescale.com> (raw)
In-Reply-To: <20120907024349.GH26709@S2101-09.ap.freescale.net>
We call the get_device() in the mxs_auart_probe().
For the balance of the reference count, we should put the
device in the mxs_auart_remove() or in the error path of
probe.
Signed-off-by: Huang Shijie <b32955@freescale.com>
---
drivers/tty/serial/mxs-auart.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 3a667ee..203e512 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);
@@ -796,6 +797,7 @@ static int __devexit mxs_auart_remove(struct platform_device *pdev)
auart_port[pdev->id] = NULL;
+ put_device(s->dev);
clk_put(s->clk);
free_irq(s->irq, s);
kfree(s);
--
1.7.0.4
next prev parent reply other threads:[~2012-09-07 2:56 UTC|newest]
Thread overview: 9+ 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 ` Huang Shijie [this message]
2012-09-07 3:14 ` [PATCH] serial: mxs-auart: put the device when exit or error Shawn Guo
2012-09-10 23:00 ` Greg KH
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
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=1346985187-30459-1-git-send-email-b32955@freescale.com \
--to=b32955@freescale.com \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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).