Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2002265imm; Thu, 24 May 2018 04:19:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZocJfubRA70M6yRdyqyoTK7lRfsUUEqqlJflASgvvv9ZwfQLUJj1zP4c34Nm4HRmx0yjEvL X-Received: by 2002:a17:902:7841:: with SMTP id e1-v6mr7027249pln.197.1527160792639; Thu, 24 May 2018 04:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160792; cv=none; d=google.com; s=arc-20160816; b=gLPClhtMMN1DTiZdapUxF+NqFgn+6gzJRxeuZ4fD1T1KU76aj/vaalow0eTF5cDFLE 5lkZ75Y15nk8/XCiA7NiEqCh7DUgKYSfOs0aiXEtaeVQ03nRjuCPYmluxMRDz2yKLdvg kdezFWByBvobeuFIyMYTbEK8f8c0ljEvDqFIoGnuVg8pygLSRuOLP5QvqNGTWC9fpbUt HFMs090jkHfuJiwac1VBEy+AjMkgEi19XSpJnfL1SLQQFQrhXtQ6qcyv/cSiBlihyeyM we3F5o2Uvz9eWtpPLqux7F0Z8kXnbo3rg2o8DMaopmOI0a/UDv0RKjUcY5JLrUeq/rJ6 6VEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=236FJdzpCivcdra6w8ZWC0tWt8duZJqcfHuOr2/MvVA=; b=tGI8HyobaVA/DHfG1eHPIkp3CrE/3IoffyJUdM8gytTX3nNVW/Ueb5tWt4lDRwDssC cJwWT8mVYapD+PmhH3hYE0Mg2UxY/nkp3zDFAYkws6CH9Lqy7AsTnWi6TCOImRYGvkXg yIVEDo46G9O3Ji5rn4wMA4FJa0XCYo6lNkBFvyBenDtbdAngaO3cfTH0pQpl8tar9S3z 9l4dc/efJG1rQyFqmqlZpZUWADyY0jgzWnbNkHIjk2QE4PMOtwPfdCzv3wBxTBN3OLZ3 kI8Sgmqd9sXUr04rCt9bSQA7OMiQ95qQc6hNfTWLrK+7i1UENuk4EhFSOPlxBPfF3lZf RO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lqBP0olE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si16636189pgt.629.2018.05.24.04.19.37; Thu, 24 May 2018 04:19:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lqBP0olE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967949AbeEXJwx (ORCPT + 99 others); Thu, 24 May 2018 05:52:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:54106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967937AbeEXJwt (ORCPT ); Thu, 24 May 2018 05:52:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E568208C4; Thu, 24 May 2018 09:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155568; bh=45PjndJYUnlNCcq/dqcRTxBfhTj7VDA/Hi4nYOn8MiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqBP0olE8dlZwu5J6RjMfIcp6sBXylOQdcxR3jDE84N9earkP0D66m6l3eQJeOcmn 3PEkS0Dm32dPathSW/hU/h1crDZt1IAZYLEdB0ms6iGpWQRSf3RDbChD/nSVZGetPC mu76zH61wv25nD7r0IHv1p8qO1tBrFEM9qTqhfhs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arvind Yadav , "David S. Miller" Subject: [PATCH 4.14 035/165] sparc: vio: use put_device() instead of kfree() Date: Thu, 24 May 2018 11:37:21 +0200 Message-Id: <20180524093623.389722946@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arvind Yadav [ Upstream commit 00ad691ab140b54ab9f5de5e74cb994f552e8124 ] Never directly free @dev after calling device_register(), even if it returned an error. Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- arch/sparc/kernel/vio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -403,7 +403,7 @@ static struct vio_dev *vio_create_one(st 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)