Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp260523pxx; Wed, 28 Oct 2020 04:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsKC8jp+06h/6t4L1/5RYjjpQMzbwJMlWSNQmhLx70J2K4RJuXdWBb4Et85f6NRyfPHQ31 X-Received: by 2002:a17:907:2662:: with SMTP id ci2mr6815109ejc.554.1603884136910; Wed, 28 Oct 2020 04:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884136; cv=none; d=google.com; s=arc-20160816; b=xyP4yMbI+1L/eg7CMwX7M+UZR/m+nsNPUzL0wuPvBbIvzKoG7iGt/4dGDt0/uoTWsr USwkT0jUdSItMftfqGUAJW0dDcIrDc2sjCoddvJzzeuzAFB4nSQCeTh//lJWBPl57YQy e9pUDUmYqRUBWjSc9rLP8INdGQF7t7UMVEmiKkMHFgs2cYKTaI7LShp7v0RklGPT13fm ki7tyY+C7kyxxFiLKiy3UDgkVrRdW3Diox31wOBPDdCAdeo6mBdZ4U0XOqsiMKUmG8rp LpXSA3MZJ8jU3Ir2r9t9Srss2O+CTx5iFkKs5dAn7LySWjMRfVpqPLjxIAZMIkpcr0be A4rg== 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=mxIcy6x6m+h3zOv4Fryk3Q35B5g1QcXvu7tD9dIEvmM=; b=t6Ri4FVaiJ2+bb2vlkvbACrOVM8LZfdAsKx65NNzNbA6j/CVV5980PJFiqmKvYhkA0 +RfMmaTannSOgEaMsPj75wVgdEbtuV/lw7xUqrMiR5et5Ez/SDWKcj/9iEP3hK/d6zdX tfr5itBHOKxLM3cS0rgtNGYRkMceB+Fpw3iQwS1O7/FOnlSE5m4JGFUKjjVE+HRpHmmp zwpGff77ELeFEaJ6cUKFX/aJ5ZW3UiQ/1XQzC5UXRD4tNh7gZ3MihAO34BgQ0Y3Csis8 8KzHgJmgzRfqnioKOwO4/lcL/FIoaSt55FMbGyxl1f2w01Z81997ZarkM45NkOD35xwH AU+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="d0/CmsMp"; 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=fail (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 y9si2654785ede.591.2020.10.28.04.21.54; Wed, 28 Oct 2020 04:22:16 -0700 (PDT) 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=@kernel.org header.s=default header.b="d0/CmsMp"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1789700AbgJ0PCd (ORCPT + 99 others); Tue, 27 Oct 2020 11:02:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:32846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1784669AbgJ0O71 (ORCPT ); Tue, 27 Oct 2020 10:59:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 7A72B20715; Tue, 27 Oct 2020 14:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810767; bh=mNhTHkVmX3M/Ysu7IIgyyOYMb5QWzrLt9mkFamXepxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d0/CmsMpAPj6VoxscQZ2frKvauU2pTWpX37QYuuL6XswjtexSnslQlXEKe/gDvTAN 653JoVAD42M/V2eyF5aseSMU2HebKpWDJJeBpTSn7/p8OFbjUjsFqal3CcaNNr7xsC nbKTztT322WpbdgC+AeUckOIWG6fOHnJS2r0Pb3o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Kieran Bingham , Laurent Pinchart , Sasha Levin Subject: [PATCH 5.8 257/633] drm: rcar-du: Put reference to VSP device Date: Tue, 27 Oct 2020 14:50:00 +0100 Message-Id: <20201027135534.716222545@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Laurent Pinchart [ Upstream commit 2a32dbdc2c7db5463483fa01fb220fd1b770c6bc ] The reference to the VSP device acquired with of_find_device_by_node() in rcar_du_vsp_init() is never released. Fix it with a drmm action, which gets run both in the probe error path and in the remove path. Fixes: 6d62ef3ac30b ("drm: rcar-du: Expose the VSP1 compositor through KMS planes") Reported-by: Yu Kuai Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin --- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index f1a81c9b184d4..fa09b3ae8b9d4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -341,6 +342,13 @@ static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = { .atomic_destroy_state = rcar_du_vsp_plane_atomic_destroy_state, }; +static void rcar_du_vsp_cleanup(struct drm_device *dev, void *res) +{ + struct rcar_du_vsp *vsp = res; + + put_device(vsp->vsp); +} + int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, unsigned int crtcs) { @@ -357,6 +365,10 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np, vsp->vsp = &pdev->dev; + ret = drmm_add_action(rcdu->ddev, rcar_du_vsp_cleanup, vsp); + if (ret < 0) + return ret; + ret = vsp1_du_init(vsp->vsp); if (ret < 0) return ret; -- 2.25.1