From patchwork Sat Feb 17 15:02:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 202643 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp364303dyc; Sat, 17 Feb 2024 07:04:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXLBbe6jn9af9PzDpPKco/QXMC8+b3ZsfkFeAocc9mYzivLOsER4QtICRFd6DI7cnzcUGeV4zGt//pCVt6HQHFVfAvsqA== X-Google-Smtp-Source: AGHT+IF6+wWt05JS6Y2erAfhOoC/OREYKPQe1K9mqZplPFkpIdpD88i/eb70voI0m3gguq64qR7N X-Received: by 2002:a17:906:a1cd:b0:a3d:6eb4:9768 with SMTP id bx13-20020a170906a1cd00b00a3d6eb49768mr4741637ejb.46.1708182287453; Sat, 17 Feb 2024 07:04:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708182287; cv=pass; d=google.com; s=arc-20160816; b=YYP8L4nuXv0Kg2GzyQSCjLpXIUtXZ7BL+cSPE+oZMcvR7n3i26LwQJuc8KMPEqT144 I/PccfwEQgOj3Mh6VD9vRew0uyQpz3b3npUpOWExDFnZN6Puh+5fQZmvqa5hsi3L9Bbp Lbp6s0k+yMLK+6/dEsNscLBgM4YQV6AjCEh2SdVT2Ir89lS/IqXYrd9s7zbIjBWkT8kv vmvzqIJ4Uh24QHljiT8XdJeIMjH4G53qkU1vDG8PJ2HiwdhfTziokWvgUOKZFz5FOaER sydvhIaKjxaaWwww8LjcV7WoNLr7BhyijZ9NZr9DqxDzUob1VcWK4eVflxYWuDy2RgEl Ts2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=X1yTF30tRRYkuEKzOUdIvpUcu3gPCLdfG/TO6+W1ENc=; fh=pcX3nLBLzYPdmuawBHbOhWNtQQD3frRXqpw6hcDvZ+Y=; b=O6t5E6Hb0RbiTiSZyb5FABaHwapI1OgkSLE//rKFhzVu49oUfpwPZ/8CBR/mck58oV iyNGC1gNif4vi1RxVLsO90/rTfMrtn4XgLyUm0zxxlaqZn8nA/jDfiiFWTfpzDrrMuvw SH76VXEZLNh1uw+WBBxR/g895FbJcTzh6dmOiiXRkJLWHWfzsXlUH8OR5OMKiRGKVZ9N BbPtirOXMoLl0XcO2aiZT0ODqN5GCQyKVkehG7NOP8yApcpehXhGupFDRKhBg3BHi4iv 8KNryiL957UA9Bbi7QUWSyB49V4DooGRdVf79oLro5wfyt3dZ0BDB3unFfCSaulVdGMg wdOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eEqGR0C+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69926-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69926-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l24-20020a1709065a9800b00a3da11e91d4si947565ejq.319.2024.02.17.07.04.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 07:04:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69926-ouuuleilei=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=@kernel.org header.s=k20201202 header.b=eEqGR0C+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69926-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69926-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id EF09C1F219F6 for ; Sat, 17 Feb 2024 15:04:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 639FA7E567; Sat, 17 Feb 2024 15:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eEqGR0C+" 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 96DF37C0B2; Sat, 17 Feb 2024 15:03:03 +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=1708182183; cv=none; b=CCoKO7Hg7fdIT2keUiUAWP01m1eXRKD8AKYcnEj0U6+FlihDjxcAh8Q+T2dnJypmoeIE9+irhjIxXl2Nendw+dUWsDyrSWp2VbXDptZeH6mG3Q2SoYSNzfpg4r1KkiDmkWexegV62kCSRwGBcPIegFIW3I2oE8k1M0oEqxJxoCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708182183; c=relaxed/simple; bh=POmhG3XikVsaXc0RusI64Jf3HUeMzGtS54gIumrv1I0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gy0UdPF/6SgLV2fqa2DD/a/eOGnC2H273mobdv9NNxfkgg9hs+wui+w78Tq3wRQSKx/X45K2+vLJLWxhDPXbEsfHOvMMrBgG6z6V5vhWDT45eYGUrDpbotiMQNTzsnNJIRvxX23zP6lrVC/RPfc+qr0i72CB4rHWjoP3EQTZScM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eEqGR0C+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17518C433B1; Sat, 17 Feb 2024 15:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708182183; bh=POmhG3XikVsaXc0RusI64Jf3HUeMzGtS54gIumrv1I0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eEqGR0C+9C6T6cV2g4R/ygaPvBNcGscgTTbDfWpt6RqNCVCSNemlDmMiBjLINFF9K vNOWBEXAul5FUj2axKYGDdckCtDO4TfXoy/tk+8sx+M+Nax3pT9M4+S/bHKHCxiynt JVidLDi1X3iyquM1kp0a0kub0LV/yLpN3RHEru2kNVYZ1+NxnuinFZsD6q3h74J/bF QqKCFNwEidPJOkwPHGJM73U2yVQ+4BuksOAvfFpAIVLuaZV050HXeu1xqCZl2QDBHY upv4mvxbKoOiSRj0B/wbcx4RIR8QiHUJlV8SjhAA3Z57ya1yYljjfWRvPgLGCifDKc 1sh5+H+c0Jn0g== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rbMDW-000000001Vo-2L8p; Sat, 17 Feb 2024 16:03:02 +0100 From: Johan Hovold To: Bjorn Andersson , Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Vinod Koul Cc: 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, Johan Hovold Subject: [PATCH 1/6] drm/bridge: aux-hpd: fix OF node leaks Date: Sat, 17 Feb 2024 16:02:23 +0100 Message-ID: <20240217150228.5788-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240217150228.5788-1-johan+linaro@kernel.org> References: <20240217150228.5788-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791158950250252667 X-GMAIL-MSGID: 1791158950250252667 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 Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Reviewed-by: Neil Armstrong --- 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);