From patchwork Thu Dec 19 15:03:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Levente Kurusa X-Patchwork-Id: 303574 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 556BD2C00D3 for ; Fri, 20 Dec 2013 02:17:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753687Ab3LSPEQ (ORCPT ); Thu, 19 Dec 2013 10:04:16 -0500 Received: from mail-ee0-f51.google.com ([74.125.83.51]:64307 "EHLO mail-ee0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753666Ab3LSPEM (ORCPT ); Thu, 19 Dec 2013 10:04:12 -0500 Received: by mail-ee0-f51.google.com with SMTP id b15so533664eek.38 for ; Thu, 19 Dec 2013 07:04:11 -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=xNPmYLUFV/Cmd1QdRoroMka/llPMvvyCQNSrqGK4wH8=; b=qXB6fd9oDa+gpHqE/nVJ1iFcxunZh9qfAXGA1LEpRBEq1CYWVQoyy+kfC/LCA8RVim ns1q60Z4TRv8YyT3EIjZNSIDdpLUPGcRD0Ij/6VNKpoxgpUcU3DL0xvScez3fuTLcZm8 rL9uVHiQUoDU9AyFZxEvqgiCMyt4VHJL9lcNiowAVpG/CTBrgp9BsOerq0IfKgYczspC 63g1OhY46Wptd4kNp/iPgVLLBn/4RMK/qlDsANeEn5hJ7y2o3w/pwGPXpym5rlLRa4dS VuzlBiv84QamNDNn1kCwXdwG55Us6Qt1x9oKreWGJzMFQzFeovj8ma5uXpHA3xcyf3oF 4Khg== X-Received: by 10.14.69.200 with SMTP id n48mr203415eed.54.1387465451394; Thu, 19 Dec 2013 07:04:11 -0800 (PST) Received: from localhost.tiszanet.hu (mail.mediaweb.hu. [62.201.96.214]) by mx.google.com with ESMTPSA id h48sm10102799eev.3.2013.12.19.07.04.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2013 07:04:10 -0800 (PST) From: Levente Kurusa To: LKML Cc: Levente Kurusa , "David S. Miller" , Federico Vaga , sparclinux@vger.kernel.org Subject: [PATCH 05/38] sparc: kernel: add missing put_device call Date: Thu, 19 Dec 2013 16:03:16 +0100 Message-Id: <1387465429-3568-6-git-send-email-levex@linux.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387465429-3568-2-git-send-email-levex@linux.com> References: <1387465429-3568-2-git-send-email-levex@linux.com> Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org This is required so that we give up the last reference to the device. The kfree() has been removed because put_device will set the underlying kref's reference count to zero and hence vio_dev_release will get called resulting in kfreeing the structure. Signed-off-by: Levente Kurusa --- arch/sparc/kernel/vio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index 8647fcc..fb0088d 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -307,7 +307,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, if (err) { printk(KERN_ERR "VIO: Could not register device %s, err=%d\n", dev_name(&vdev->dev), err); - kfree(vdev); + put_device(&vdev->dev); return NULL; } if (vdev->dp)