public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Levente Kurusa <levex@linux.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Levente Kurusa <levex@linux.com>,
	Roland Dreier <roland@kernel.org>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	Jeff Squyres <jsquyres@cisco.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	linux-rdma@vger.kernel.org
Subject: [PATCH 34/38] infiniband: core: add missing put_device call
Date: Thu, 19 Dec 2013 16:06:48 +0100	[thread overview]
Message-ID: <1387465612-3673-35-git-send-email-levex@linux.com> (raw)
In-Reply-To: <1387465612-3673-33-git-send-email-levex@linux.com>

This is required so that we give up the last reference to the device.

Signed-off-by: Levente Kurusa <levex@linux.com>
---
 drivers/infiniband/core/sysfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index faad2ca..bf279ce 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -824,8 +824,10 @@ int ib_device_register_sysfs(struct ib_device *device,
 	INIT_LIST_HEAD(&device->port_list);
 
 	ret = device_register(class_dev);
-	if (ret)
+	if (ret) {
+		put_device(class_dev);
 		goto err;
+	}
 
 	for (i = 0; i < ARRAY_SIZE(ib_class_attributes); ++i) {
 		ret = device_create_file(class_dev, ib_class_attributes[i]);
-- 
1.8.3.1


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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19 15:06 [PATCH 32/38] pcie: add missing put_device call Levente Kurusa
2013-12-19 15:06 ` [PATCH 33/38] scsi: transport: " Levente Kurusa
2013-12-19 15:19   ` James Bottomley
2013-12-19 15:06 ` Levente Kurusa [this message]
2013-12-19 15:06 ` [PATCH 35/38] media: bt8xx: " Levente Kurusa
2013-12-19 15:06 ` [PATCH 36/38] dio: " Levente Kurusa
2013-12-19 15:06 ` [PATCH 37/38] uwb: umc-dev: " Levente Kurusa
2013-12-19 15:06 ` [PATCH 38/38] bcma: " Levente Kurusa
2013-12-19 22:10 ` [PATCH 32/38] pcie: " Bjorn Helgaas
2013-12-19 22:34   ` Greg Kroah-Hartman
2013-12-20  6:15   ` Yinghai Lu

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=1387465612-3673-35-git-send-email-levex@linux.com \
    --to=levex@linux.com \
    --cc=akpm@linux-foundation.org \
    --cc=hal.rosenstock@gmail.com \
    --cc=jsquyres@cisco.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=roland@kernel.org \
    --cc=sean.hefty@intel.com \
    /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