Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1282831rdb; Mon, 19 Feb 2024 09:49:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4zoHVy5N5uNKRm0XG/XE03YBvpJxvVEtF7L33kfuw3PfRMxlSaVjFBldvMJ/+qOhGTkzlz6u7QE1WARkoK22++9qKqrif3wtbJGeLlw== X-Google-Smtp-Source: AGHT+IFng3RQYOT1TRAy6pbjhQgzeHcWWtFJjoDfBQYwv2QARfHDNQ3bIYTy0Lmmhk5eH8QMBVG+ X-Received: by 2002:a17:906:3c4d:b0:a3e:de8b:c73 with SMTP id i13-20020a1709063c4d00b00a3ede8b0c73mr601977ejg.28.1708364983535; Mon, 19 Feb 2024 09:49:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708364983; cv=pass; d=google.com; s=arc-20160816; b=TNAEnDi0r2gSY6Nd3AZ+cwrAwH1pZWpDZBXrTEfKZv/xB8eBSJhSazYCyhrhEsMFQr 0E0efVOO13Y59YRGu3/Va7Aua3yC4guzd6hJGzCBPlFtixPek+Ut+zV/g59B2q2o/C2E m8Gmo0BfQchz+NR2qxJFQIQhboFS1iaQCIAGc3CX3pYsTReWU+5fKPWC0MbfSf557XRU QAlndTQgwBU9znV/3K45FVn9UbKGPHGeTyslPcEDqNL4XfPFmeCSFPyujI2m+ZQ1VPH7 SucoWOR9sJ66opP5R+nuj77t7iW3CNoVH5SAZL6UQ8ACeQrDjGQhvh3SImbyZ33FXdH5 /HcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=F28LxihjOAGYoZE0q064hLUHki9BkGAzp7yZr4oez8M=; fh=tSGq4+SgkmOhWmr+FS2ZJD5vbh23kpi916FMrTTBdO0=; b=ETMMFuNb+XGSXcnOcldWkSIFJNF12t+vvDGMKdLUe4DJVRaUpHDUA2akk1qAY8l+0z IXjRGIEHN8CZ0cGqhIiTW8fnPBZDUBNz18oljCniUldRDH+AJIawpbUyfmlfBqQ5CyW5 4sXZhLpd6yrC1Wq3K10SP/hwZirfygBeZlUNiTR2kynCRtpWZ9SA/+pqvYwqecdVaxdp XYIUP/X5qQKRzYOjV2SU7xBU59cjE2+09gjoNRoBg/dnYZfExb1yMH+zwKsKIsVPfhMS Ts9peaf2xBeBNtMoDkMvEB5hz8iS6d7d2dAihqWgvet/wtHnsFn2l2ZdAb5THa0a5lcQ mx+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=h4sRlf5z; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-71778-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v16-20020a1709060b5000b00a3cfaf0962fsi2600211ejg.448.2024.02.19.09.49.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 09:49:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71778-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=h4sRlf5z; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-71778-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4D0F71F23457 for ; Mon, 19 Feb 2024 17:49:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A31A64594E; Mon, 19 Feb 2024 17:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="h4sRlf5z" Received: from mout.web.de (mout.web.de [212.227.15.14]) (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 8771544C8D; Mon, 19 Feb 2024 17:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708364971; cv=none; b=c1OBW3QoofEwpzeZKmFnJ0WiOmSGaXh7rn1D4yFmOY4lQNdz+pCgTQ9EPOk11oAR/O5p4CcikEHFC0+5Y+FDI2YWnnMgYm2Wr7VecEfPDu2Az687pd5Oh2eaJMMWeO/ADN27sNCjmH7fggaxJEH7fj9W3KGxuyJla/PKehSObkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708364971; c=relaxed/simple; bh=hPupRt57+r+Pl0dfVnsjq1GsNhHpCJ6eXReICe+eDDo=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=elpbcyqsRDbiOr7y+H9F8/zr0K9L/Lw2MV71f9DXzp5Iab4noMbNf/+EsuBzCXnnx/wBBZAl8XCPuQkC4zDBC26O8gEaBOyge3+r11CUbighCudMlQM07tGSVRWvOfccWZu1xXMquPTqmch5k3CBR5Sg70B64QBuJA6q0pYnH9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=h4sRlf5z; arc=none smtp.client-ip=212.227.15.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1708364915; x=1708969715; i=markus.elfring@web.de; bh=hPupRt57+r+Pl0dfVnsjq1GsNhHpCJ6eXReICe+eDDo=; h=X-UI-Sender-Class:Date:To:Cc:References:Subject:From: In-Reply-To; b=h4sRlf5zIV+QWDila5ohfglWmS12NfxX6Wx6NvhudyKq05oHZRWmmvB+yQAl/USd s/hF88fZLogXlVoPr9rYZcV6U1BvLPtgrwOs3I0XIdBFv8XpCNCNY3EEijkJj1DzY 5VvHfB+6tRpIy0Tq9+g7oAj5CiRYslmyzxurJVIsHN3Kc9uYA8tBa3N1Mp5L6Y/wr oucP7TurufLy2QMHeMn/SgfhJjg31IVk1/FHtcdSB/Axxv9EWjjleNaSPrJeU4eX5 oZ7w/z6ZtPYAINIoef5Lp0bfUVTHb8xQlzM7tiiHXC7yK1h1ujvgMvoDn/CvIgI7W Yu6xFw2F9eBfP/W1YQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.80.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M2xrs-1rfQbv2m5c-003JhM; Mon, 19 Feb 2024 18:48:35 +0100 Message-ID: Date: Mon, 19 Feb 2024 18:48:30 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Johan Hovold , freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel-janitors@vger.kernel.org, Andrzej Hajda , Bjorn Andersson , Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Robert Foss , Thomas Zimmermann , Vinod Koul Cc: LKML , Abhinav Kumar , Dmitry Baryshkov , Jernej Skrabec , Jonas Karlman , Kishon Vijay Abraham I , Konrad Dybcio , Kuogee Hsieh , Laurent Pinchart , Rob Clark References: <20240217150228.5788-2-johan+linaro@kernel.org> Subject: Re: [PATCH 1/6] drm/bridge: aux-hpd: fix OF node leaks Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240217150228.5788-2-johan+linaro@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:1qY8TG6XGBPBySkXD9Iw+B/jMk+ITC9FUkKiHaIFz/AtRCFm3X8 A2bG3gibnYIc7UfT5py0ZV3IHcRAAwqod7yJen0dD22Od/rMMXKMtv4O3ehHFd6NK1O47oF 2FKhSK+MFr0qgPhK4sp6Gvv75D7So3Dsd6VTfJ4FGrbLdu71hXEBz4h4bEnOqoDzSyVLUQM FFo2segx5J963ehK0Nyqg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Vt1j2p9N3tU=;Y5Fkv24B75ZRsEO6v+JeViz6QDS Z0Qr1vSndEAhOcBQzzzF9Hc+zTH8Lh5ACQIDs7Em43y0RsMfANmO66fe8KzHagSpTU3nCS9yw seqRMXtdrL7zS+FYfxRWVQMh2n+AW0LD8yuU/LvcAOqSzpZuAxCp9sB894cWb6Vs/KQwhcvix 0c0MCspFvzytZ8Z/VmjJpOa6U7u79EUFZbSTMcXdtOidhEyGaXoD1ed1lSk72ZHY4WrxBcoIG AQDpd7AAX8XoGPbGzDh8DSIIf76R1xfHsRz/IWtBKre8C5hyOZibsT6rlCWZf1Hn4OY8nyGe8 0R7jtfGDhFTNaLob/euJ4Xouo1S6JDEo6roUqqRQhLm+eihsK/1yoocr3e4TN5EfooNR/mqlb JU0s2ZXbFHxS1HxFt10qTR2Q3UBDpjnHxaf0nc6H7jpfWpYApArkm5d6/CArQHWMYRyHggilo NOJYAzpbA7OAaB9NNxId1wvcwZvrTgkzAeabC2c5HsL0UzNsbWqKbMMceESmfn72wOIfsQIsP L1S6NcAESVAnTYRBVYmDfWpuRiWfiWzh6aw9JFeF6HLm6Y4ajY/9ve+rE1vwM2zw9Na/oA3vn fbfuZnuDVcd6HgPLX6VmhUXnUzA/O+87vE3/mjhRZ30qPnFNmB7/gDo+4lkRApUIZ+Y5SsU8T C/RmhXE33yy5bOoTU1jR3W+iZ1ylFub+AO8utosVVJ5xfLspRIaoR6ptLogpbtO8A+duLEl5g BTecZA4H8EdbrwYdstFYfumSnHWDkijS5WNqggvyMOhheue05/XZGimtzonJucoBOFIY89JRK mjveQA3OLbiH8J7EvTIIAlcAE3cn0wtcE7uXKqhPCSnq8= > The two device node references taken during allocation need to be > dropped when the auxiliary device is freed. =E2=80=A6 > +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c =E2=80=A6 > @@ -74,6 +75,8 @@ struct device *drm_dp_hpd_bridge_register(struct devic= e *parent, > > ret =3D 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); The last two statements are also used in a previous if branch. https://elixir.bootlin.com/linux/v6.8-rc5/source/drivers/gpu/drm/bridge/au= x-hpd-bridge.c#L63 How do you think about to avoid such a bit of duplicate source code by adding a label here? Regards, Markus