From patchwork Thu Dec 19 15:06:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Levente Kurusa X-Patchwork-Id: 3381911 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3A696C0D4A for ; Thu, 19 Dec 2013 15:10:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 947432069A for ; Thu, 19 Dec 2013 15:09:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4994D20697 for ; Thu, 19 Dec 2013 15:09:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754850Ab3LSPIZ (ORCPT ); Thu, 19 Dec 2013 10:08:25 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:62295 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754787Ab3LSPIV (ORCPT ); Thu, 19 Dec 2013 10:08:21 -0500 Received: by mail-ee0-f41.google.com with SMTP id t10so544494eei.28 for ; Thu, 19 Dec 2013 07:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=R29mSTB/g0xrIoo48MnCrV8RXu34CvvjAVrlOMTQCeU=; b=1EWcvkEvLdQIC1IjSf1V3L87BkAVQy9nzx6SD+bA7rRZEEf59Cd8epijHi5CCdMZNu 96nRHO7SmCKyEjNdwVYtfL7CrJRHPFpaTp3HCIo9efCf24DNHACd2trKgPdcic9H1OYh 5lh6fwXJ1GyJ59rZCVQ/LyQ1xG6C2A604Yn5nEn6FwKLrIVhPzPTNYFSmuYdeyiqK0uh dYGONRnGAXOeMapR5zM1oOBDLT2ty0NB0QyRIvTOlcGFTqw27K3fpmGuu/q8kDM3kYBH Jgo9jCd7I7k4zTpTLc3nK9+ssu8hr5eiJ4xW9HLhE3vHEiy9iuIUZCkJIJDhKBiTx0wN blLQ== X-Received: by 10.15.56.7 with SMTP id x7mr74523eew.43.1387465700488; Thu, 19 Dec 2013 07:08:20 -0800 (PST) Received: from localhost.tiszanet.hu (mail.mediaweb.hu. [62.201.96.214]) by mx.google.com with ESMTPSA id n1sm10081372eep.20.2013.12.19.07.08.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2013 07:08:19 -0800 (PST) From: Levente Kurusa To: LKML Cc: Levente Kurusa , Roland Dreier , Sean Hefty , Hal Rosenstock , Jeff Squyres , Andrew Morton , Kees Cook , 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 Message-Id: <1387465612-3673-35-git-send-email-levex@linux.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387465612-3673-33-git-send-email-levex@linux.com> References: <1387465612-3673-33-git-send-email-levex@linux.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is required so that we give up the last reference to the device. Signed-off-by: Levente Kurusa --- 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]);