Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp61831rdb; Wed, 21 Feb 2024 17:22:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXt/4F3q6Er0ThFlsLQCOOLXuztbzZ/8AUqYC2e6NZhU+yYU4MQh7q+uPgsM4oPs/JiWmoW0pWdRPkRmB6WWSwlBfKKWdK7WtVT98S6uw== X-Google-Smtp-Source: AGHT+IEhkXpbn2fSDNAL9PWTCILYR1QUt/St05fDYEdxcFZc9wWJz9sDvIdYC8E4otMsfedTbCgF X-Received: by 2002:a17:90a:68c9:b0:29a:3283:e93 with SMTP id q9-20020a17090a68c900b0029a32830e93mr1961954pjj.8.1708564964244; Wed, 21 Feb 2024 17:22:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708564964; cv=pass; d=google.com; s=arc-20160816; b=cayQcjA4jUtGKa7QSARZx049KlirQnm2LWkRNCkS0rhgGxmWG/f+cMgDTYpfUrjjnd 9TpycUviHSip9ScQzedwFZUzaCsDwIRCqGsiuXPMJ6gZS5ALJm63pgwDIbLy9iZ+Thme K753t8LdJFLJHR2ZItgGb5+BX9OSTjdcOSa3/fN8mC3PVTXClZEhYU9ECiddHVJ5dZjw 1ppNtqvKYg77LmX1r3JciqdAYQFq2MuLKpg+ZHJVwuf6z5tu3GsiI5l0Qigz29vbf00Q SSchI9Tp4yydpBS4Kz7ULZB7U9177GOVm2MqVUyM5mieez4Jgq2FN2EUxh5S5wAg58D6 +1bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gYqiygw3/24QVb4UMKkxw4yihlYDphkO5E/0RSw06nE=; fh=HSwUWE4z8kNwy2s1X5YudKN3+itD2pFToYTnIUyxH7g=; b=CDwiZxTT7DIuJRKuS0lC2OZ//jMsHk/jOWoOxQHAtL+8V4DYEmWxXuoDUsWE04c5IO R53imiU7LyWCQL0vHth6NdNMX1V3ZxTV3EocVLJTbmDaZ/3QRwJ1OWE37upBOkE670i2 65sr+ISHx17owuGMODsQmERvnFBgPwUeXlaCkaoI9fKLCvSY9v2bDQCyBuLfStspOtSm C0YKk9b5aJ0v/5CI7nOrMvbAW6dam/dnPXwvUvWzHeyI7hSfwl19SpF62eF/UqGo+H6S 2pVM57BwnjcVPStFNGykkDKJsiky8ymcg0r0WteisuYCaFtiNpgEea+79y93E3ZvY48A Djug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZYHtQU7M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id mq7-20020a17090b380700b0028cf6318076si2499212pjb.98.2024.02.21.17.22.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 17:22:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZYHtQU7M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 34508B23F61 for ; Thu, 22 Feb 2024 01:22:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DE6412B9A; Thu, 22 Feb 2024 01:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZYHtQU7M" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83D1811724; Thu, 22 Feb 2024 01:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708564951; cv=none; b=ttczLui2/Amm8njtAGUqITM0oJa/PdyQUedO1+CmD9n/okJmM16w+nrV3Gs/CA1ui5ZPotqPvg4jDRenZ/WhorKH83cfDD1yQLn+/Kzb/YnUN0DRNbWqX0qiAs9mZBqLvI8CpGAURUSD1ZQgeW8vQf+8XmTdTKvglpKsvBXu684= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708564951; c=relaxed/simple; bh=8Gg4bD6vnGa/ihYXZ1047KooWejaE+1erFa2VYXuF9E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u/qc80RKqYJwfCfClfgGTqffObtwUzeUlnQa2cG9BhXxVAtgBdIQ4J0Fd9EQj5SCLTxS2CIYnwgd65Go2QVXNXJG71DDrho2SAtLROFVN9vwHixbCEt0UqjnBzKgMGwJhnYYkTvRgdanJoYDlxjXRodA4dOeeEhkxnTVrrC7DLo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZYHtQU7M; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48717C433F1; Thu, 22 Feb 2024 01:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708564951; bh=8Gg4bD6vnGa/ihYXZ1047KooWejaE+1erFa2VYXuF9E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZYHtQU7Mv/GCNI0yL8RMHsMF/ZegGIuZqV+ymww3V9s7XwbHQuKONVFzVA7hoonpI Jt/gLGnHD0CvJdG+Mqw5AEFnU3GgV+xkqlrOT1l0JhTkj7p18G0ZQABJIZgph8HBDR Icuv+0JngsPayepXdzwql7ysTCIyE76+qJ4WOsxO2zmeIbt/oeTFqsp0rYZALvzCp6 P9PsjhAD3oAD/mHFbJWY/ff0T++CL8XzhNPiqQXo1Z2O5CCm/IWQAAVS+0hoDZf9Cb wOOW7BfGDgkfbVPYL+8oRxyzeW8H/tSTwnRSD62aMFLrF8KrRaWpdAqCpl1woHNF9X gLuN5sqBp2c7Q== Date: Wed, 21 Feb 2024 19:22:27 -0600 From: Bjorn Andersson To: Johan Hovold Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Vinod Koul , Jonas Karlman , Laurent Pinchart , Jernej Skrabec , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , Rob Clark , Abhinav Kumar , Kuogee Hsieh , freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org Subject: Re: [PATCH 1/6] drm/bridge: aux-hpd: fix OF node leaks Message-ID: References: <20240217150228.5788-1-johan+linaro@kernel.org> <20240217150228.5788-2-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240217150228.5788-2-johan+linaro@kernel.org> On Sat, Feb 17, 2024 at 04:02:23PM +0100, Johan Hovold wrote: > The two device node references taken during allocation need to be > dropped when the auxiliary device is freed. > > Fixes: 6914968a0b52 ("drm/bridge: properly refcount DT nodes in aux bridge drivers") > Cc: Dmitry Baryshkov > Cc: Neil Armstrong > Signed-off-by: Johan Hovold Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/gpu/drm/bridge/aux-hpd-bridge.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c > index bb55f697a181..9e71daf95bde 100644 > --- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c > +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c > @@ -25,6 +25,7 @@ static void drm_aux_hpd_bridge_release(struct device *dev) > ida_free(&drm_aux_hpd_bridge_ida, adev->id); > > of_node_put(adev->dev.platform_data); > + of_node_put(adev->dev.of_node); > > kfree(adev); > } > @@ -74,6 +75,8 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent, > > ret = auxiliary_device_init(adev); > if (ret) { > + of_node_put(adev->dev.platform_data); > + of_node_put(adev->dev.of_node); > ida_free(&drm_aux_hpd_bridge_ida, adev->id); > kfree(adev); > return ERR_PTR(ret); > -- > 2.43.0 >