linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: levex@linux.com (Levente Kurusa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/38] arm: mach-integrator: add missing put_device call
Date: Thu, 19 Dec 2013 16:03:22 +0100	[thread overview]
Message-ID: <1387465429-3568-12-git-send-email-levex@linux.com> (raw)
In-Reply-To: <1387465429-3568-2-git-send-email-levex@linux.com>

This is required so that we give up the last reference to the device.
Calling put_device on the failed device will allow lm_device_release to be
called which will kfree() the struct lm_device.

Signed-off-by: Levente Kurusa <levex@linux.com>
---
 arch/arm/mach-integrator/lm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-integrator/lm.c b/arch/arm/mach-integrator/lm.c
index f52c7af..1199f38 100644
--- a/arch/arm/mach-integrator/lm.c
+++ b/arch/arm/mach-integrator/lm.c
@@ -89,8 +89,10 @@ int lm_device_register(struct lm_device *dev)
 	ret = request_resource(&iomem_resource, &dev->resource);
 	if (ret == 0) {
 		ret = device_register(&dev->dev);
-		if (ret)
+		if (ret) {
 			release_resource(&dev->resource);
+			put_device(&dev->dev);
+		}
 	}
 	return ret;
 }
-- 
1.8.3.1

  parent reply	other threads:[~2013-12-19 15:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1387465429-3568-2-git-send-email-levex@linux.com>
2013-12-19 15:03 ` [PATCH 06/38] arm: mach-s3c64: add missing put_device call Levente Kurusa
2013-12-19 15:03 ` [PATCH 07/38] arm: locomo: " Levente Kurusa
2013-12-19 15:03 ` [PATCH 08/38] arm: mach-rpc: " Levente Kurusa
2013-12-19 15:03 ` [PATCH 09/38] arm: mach-imx: add missing put_device calls Levente Kurusa
2013-12-19 15:03 ` [PATCH 10/38] arm: exynos: add missing put_device call Levente Kurusa
2013-12-19 15:03 ` Levente Kurusa [this message]
2013-12-19 15:03 ` [PATCH 12/38] arm: s5pv210: " Levente Kurusa

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=1387465429-3568-12-git-send-email-levex@linux.com \
    --to=levex@linux.com \
    --cc=linux-arm-kernel@lists.infradead.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).