From patchwork Thu Dec 19 15:06:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Levente Kurusa X-Patchwork-Id: 3381921 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 39C6F9F314 for ; Thu, 19 Dec 2013 15:10:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FA2C2069A for ; Thu, 19 Dec 2013 15:10:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2064B206A3 for ; Thu, 19 Dec 2013 15:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753188Ab3LSPIN (ORCPT ); Thu, 19 Dec 2013 10:08:13 -0500 Received: from mail-ea0-f169.google.com ([209.85.215.169]:35566 "EHLO mail-ea0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395Ab3LSPIL (ORCPT ); Thu, 19 Dec 2013 10:08:11 -0500 Received: by mail-ea0-f169.google.com with SMTP id l9so460554eaj.28 for ; Thu, 19 Dec 2013 07:08:09 -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; bh=cfSthw6+0jvuPqJufyewGrJ8/06EOAbBHRCwLhHmZ/4=; b=t4pUhcW/RxZoeSixQTpk8iCzJI5h/lv4EKiKGlOaVOPj6yxEeG4LYsLXD/AFszNETk bmO0duQ3IESZ8/v6r43Oae/OCqpeKIyYHdHborNXAQ9kAbhfsmMGZs3NdEKE2ed3/wGS +LQlqSzc6hkKlshLg2jFqid4GQhVYJc4qQYN6YCDdCizrhrf6QhNiDJU6gWW8lOb9bsY Yd14Ochg3Qk0CpbFbBOdEM+Ndah13M7IeBRZCewDrtEAE4Jhod6Sz6STWnXZ30AC/uAt RGf1wEooOqyNEU7yASgwgWvoSAzy1wHoooQIlw+7M219jpIJ4jc8QftehWscFQbAL8Bn xtZQ== X-Received: by 10.14.3.130 with SMTP id 2mr252824eeh.36.1387465689727; Thu, 19 Dec 2013 07:08:09 -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.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2013 07:08:08 -0800 (PST) From: Levente Kurusa To: LKML Cc: Levente Kurusa , Bjorn Helgaas , Andrew Murray , Myron Stowe , linux-pci@vger.kernel.org Subject: [PATCH 32/38] pcie: add missing put_device call Date: Thu, 19 Dec 2013 16:06:46 +0100 Message-Id: <1387465612-3673-33-git-send-email-levex@linux.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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. Removed the kfree() as put_device will result in release_pcie_device being called and hence the container of the device will be kfree'd. Signed-off-by: Levente Kurusa --- drivers/pci/pcie/portdrv_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 08d131f..80fb1f2 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -345,7 +345,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq) retval = device_register(device); if (retval) - kfree(pcie); + put_device(device); else get_device(device); return retval;