Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9117133pxu; Mon, 28 Dec 2020 07:04:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxO6EcEcC0S4VgvtbE+ECvfStqlmcH5reVahEVcBAxI39vmh4ygolG1ioibQ2QsU+4sSjqe X-Received: by 2002:a17:906:3ac8:: with SMTP id z8mr28572672ejd.273.1609167884253; Mon, 28 Dec 2020 07:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167884; cv=none; d=google.com; s=arc-20160816; b=Lc5LQYONW+fN7tCSIFC7UYjRU/1x8p71uEseT+h7rGwJQnwo0RdK9MNQ16nbtliFfE aKvYzm4/0/IDVOZe3Kvx+OEsNDCCHiBTiIXfp6x2N5RNkBZxsqvkaJuSK8yFYCFzd7P2 sAdRV6Ta46a+L+4Z2vpvjk3StcsuEJFASsWI2sxR8rBBU1tRn6q9koS047bMTAzk75Mm 3NTXFnF/JiJcI0uRyBfS8qPbuBQbbTZ3z5Uqf/cRaxgN4DubV/HMRBMm1nL2a3NPtKrw 5yIqfnV5b73YMd5x0EZfAgTVGYlYrytY2bE+03F2yB4/Lhd8uf7u0BoJRXTITgJWmtBQ mqIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Onnus7yUunSBf1Vs+jGPkukmXwrlBb7SxAuFvEiqrOI=; b=R59hQpkb4hv2cRimucJXA0HEAjD093sg2gbYhrmwOkvKRXVlbZP1qpK7kOCfg59rjR jMElSXiVq2qAC/4uKZXr4iwaWJzZF0Qp+dlsdehfwRijO7/H8zAE96B1Oe/LDuKt77N7 Dkt4JAlmJVn3GTvBgoafuaI0zwHqcmD0jbuB+6xGkmQHFBDcco1C+11dCkXmiPE7QlvS JmC27IkqtslMvCKhjxpLufh5InsM0rztpiDqyqDgUbWL+qybFEtmGUScg43fBYXuvJDM 6NquqvugQ+q1J0aLJZdWSKYepnUWU62WwOGUGcRRkuWnm7Fj4Be+UNCTXAYPJueSjKfR 9b9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O8xXIu+4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si20859191edi.157.2020.12.28.07.04.21; Mon, 28 Dec 2020 07:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O8xXIu+4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408111AbgL1PCg (ORCPT + 99 others); Mon, 28 Dec 2020 10:02:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:47560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439974AbgL1OMv (ORCPT ); Mon, 28 Dec 2020 09:12:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BD8622BF3; Mon, 28 Dec 2020 14:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164730; bh=mi/DeJzRXz47S3VNF9DlNrEgzgIcmxls+PobV+WzrQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O8xXIu+4r8CMs9nPangDpCIOJ7qvPqceQkhoqmGPmyA7IMLPr0WkaWwocVbQNNVoi fsTNVxulHP8SePmKh44LP1Tby9Fj964XU54T9Y38oNMBMzNqr3FwAHKfAOAxOw2/+J rRXFKalyJe+u8/HpfQvMO0MHgtcS7Ukyum+kbUtI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Neil Armstrong , Kevin Hilman , Sasha Levin Subject: [PATCH 5.10 246/717] soc: amlogic: canvas: add missing put_device() call in meson_canvas_get() Date: Mon, 28 Dec 2020 13:44:04 +0100 Message-Id: <20201228125032.770101033@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai [ Upstream commit 28f851e6afa858f182802e23ac60c3ed7d1c04a1 ] if of_find_device_by_node() succeed, meson_canvas_get() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes: 382f8be04551 ("soc: amlogic: canvas: Fix meson_canvas_get when probe failed") Signed-off-by: Yu Kuai Reviewed-by: Neil Armstrong Signed-off-by: Kevin Hilman Link: https://lore.kernel.org/r/20201117011322.522477-1-yukuai3@huawei.com Signed-off-by: Sasha Levin --- drivers/soc/amlogic/meson-canvas.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c index c655f5f92b124..d0329ad170d13 100644 --- a/drivers/soc/amlogic/meson-canvas.c +++ b/drivers/soc/amlogic/meson-canvas.c @@ -72,8 +72,10 @@ struct meson_canvas *meson_canvas_get(struct device *dev) * current state, this driver probe cannot return -EPROBE_DEFER */ canvas = dev_get_drvdata(&canvas_pdev->dev); - if (!canvas) + if (!canvas) { + put_device(&canvas_pdev->dev); return ERR_PTR(-EINVAL); + } return canvas; } -- 2.27.0