Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1956709imm; Thu, 24 May 2018 03:34:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrST6ox4dXp4g/iTteJBNJS+jMKM6OVO0xTzGA+dDtgHjzBZYMZ/dLWHH7DEuSQHQvG38jd X-Received: by 2002:a63:6105:: with SMTP id v5-v6mr5308252pgb.299.1527158097177; Thu, 24 May 2018 03:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158097; cv=none; d=google.com; s=arc-20160816; b=l1+wODPvQuUtS6Me1CGRCq2epmq4LajXB8j2k8Izm6611sFBnLDF7nfXcNmvfjuOfr TZ8m5l+SoAs1O8r4JDFb8/tYVF/8m99F2e4FCW16n1qCEKxqUdI5gVKN9NDNzpcX6/jd 8mtiIyQQ4BCSSMVK45aT0ps4p3bsk6w7EtKgqwtrhYgL/Avr39qG9MmTiRna+sxubEFE GNfrlGZEMfvJCRdLLhNh2+HSFfFjp01CqE5oPMS0/82PKGdGfkd35xPDs6AU7bLE07R7 x4YBSi4bfMGJczlmmYFsS3BqupbsftzzEBejWK6Qfxcy34jjrHjyqAf1jhWazoIWCVsp t6nA== 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=RtE5XOM6k0DBpjfXcz6s/Xt2wNYpUeeHuOllToRdgdk=; b=GU23qYe1J1tdplDLRUtn/EO2LwYgTfu493pGsG2N0B5rDGc8mNn9spgctptL169q2A t5pO/rLs8So1t0YR8ts/B87QkuyCti1bc0EE1DeEjzLAeQzJHuQTl4LpwTBCIJIFHDFq DWOYj5dnpYjMtcVjnLeBtgNOL8p2ViuYZUV5PC9qrLAsN0/T4Qz+YocErGhYF3+Qk5pD rXKuCv6mbLLtY0F1PFngXo+UFNozDpkXkxHu6ubRqJTU+ztCqZzHBENPjr0HFDAid4u0 wXTtsFXHEykzr05lwCFP7yLY6/W5wDBvfCKmmbUwiAyVvvM5mj5x4AxvzVLEcdXP0opL GrNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1WUG0Q4c; 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 e1-v6si21488849pln.445.2018.05.24.03.34.42; Thu, 24 May 2018 03:34:57 -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=1WUG0Q4c; 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 S968465AbeEXKAb (ORCPT + 99 others); Thu, 24 May 2018 06:00:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:42176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030849AbeEXKAO (ORCPT ); Thu, 24 May 2018 06:00:14 -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 04CE920890; Thu, 24 May 2018 10:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156013; bh=pYY3Q8k7TRqKpDiy/tPU9apALx5KusI9Dw+5P0NK8VM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1WUG0Q4cW9ELonz0O95/cqpEz+4a/u/HcqqIdAzexYmNDkPA1HSKfYSvL8kM8177f simQuTi256oNIEihUF+tFjZIe8CM80ugYTZJ5gUV9L7aoE/jslE/G2UdG7MOzXbS+3 WKzW0zmPsFTIJZXufbX7Wf4OrHjGBGVmzh/Xk5bY= 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.16 033/161] sparc: vio: use put_device() instead of kfree() Date: Thu, 24 May 2018 11:37:38 +0200 Message-Id: <20180524093022.332924297@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@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.16-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)