From nobody Fri Jun 19 09:05:26 2026 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F41253C0630 for ; Fri, 24 Apr 2026 11:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777031985; cv=none; b=SnbN31rAKVJsv5U2KasA1YaY0vkDtXLwQhZnLNCu/4fLxUkWh7BwBlG+iBYs80u1I5EaMyGTCqiZC4+nZ+TYNsi2aurBkI6Q213159YLcGZJA0MmWodVYLx0AsOZ+x3Q8pDDBvRyfR/m+W6x8tC4q/pN+gyoujUseS15NcFWulk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777031985; c=relaxed/simple; bh=kJEsAZDlrm3LwLNFR92lqil3GyrPB2PbHA+YBGgXhHI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FfaXEgz8SPy0uBFvyeGbiIOSU1411Ia6WB0X8PON3rXCcUzovW/29A/dQKqEId3p14Cf8WPwr4JJVA2UqKpeH0viKJa2RlN1xyGqkUTErPdzQPqovu+j7+qB3GCJSXt33bAe9JEI1CKo+PxaV2zqWatwYU1GgUCuJMuUigd0lHY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kJ5ffHop; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kJ5ffHop" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2b2429f98d0so45937855ad.2 for ; Fri, 24 Apr 2026 04:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777031983; x=1777636783; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QNk5Ee0nueO8NOVwzsWGTQAVezpG2J9JCi8Bol9c8Is=; b=kJ5ffHop4o7W9N5X4PnCOS/5mfdJGYFncM43TPqbOHKGA+hYYtjR5PzE4iW30KVHMf 4cyHXFXbX1gTnm6Hkbxt9ufp0cSXGycpTUfMb2fjs6Eq8qo2EbyNUjiGzHAb8HWPIjgd i7QdswwpfuEG8C/zqItplAzwj0NahzBUS5+YziZ5FatQGhqEAEfT9keJD5slh8zymBVI FeZK3LFnFZ+Zc2UY4cJsulLQPFeZ9Z4IHV3DU9LvOndKMmLu/JKnbHG377zvrM2Qa1rE 7yoqljyz6Tk4jbn4nW2PgLwuXTw2bxg3d7OBpwWyV5+5eyBP1cNCgoTcKcyrINToI/Ug 00LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777031983; x=1777636783; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QNk5Ee0nueO8NOVwzsWGTQAVezpG2J9JCi8Bol9c8Is=; b=UteLuWEv4/PAwc0UVfhVs9vpe+uo2Qm0SqyQ0EVMCh2PtRk8VLGoF5Gizt7gEscR8W iSXV9jQq9uFgENDuAIQB5Y6TLToRm30rJh1RgJDFlOuv1IrC3HuynEVwBoZr6iCldt/6 u5GC6oIogMmtJdWDv7UGgFEznKBATSFPeYjHTCPU26EjpPT902Uk2XV0jKzJLxRGAw5+ +jApWCO9XiPKctk8ElIDnELEP0HR+nzvU5bRUpcEgSBZtHz3yE2sUhmfR5e9kz4I/l2H SJ28AZSK2mDPzh8j/rEuyQnCD8oAksOJ+iteqe/cVnpMQDwEyC1yiwtW6s+/motK24JV neEw== X-Forwarded-Encrypted: i=1; AFNElJ84UoX9IwSX7/lp1/D6/MGj4EVKIBUB2GidogtPCE7mqZ/Iiec/m8bY5PqTyEPdFyfd9J65vJAUm3TSUT4=@vger.kernel.org X-Gm-Message-State: AOJu0Yxx2ToNvGo891IEe1raLiSDzScllu2a6g8dW5yXs5jjv6dZ+FNa IM7T7yqiAGb8olXL1TH6wR5f7bIclQp/l5v2fvqkL1G0YXQzWbJ4qb0= X-Gm-Gg: AeBDiesz/7LZflOTkXz9+7Ioy69i4Uq4wEV9Nh+Azujmt9OIwKEUkYNZk8HR6MXNzv/ 3F83pwvNt4RMbqJrRXLWEFVRTpKwOkjORYVLRwWif8BT28BkMwSGiFy5xsUmcN/etLkCGQy+TYA tE/r9ejPL60pwzRoGlkZ5pKPAL9RnNvY9GFnBGv2nT0lTwwk7QtZOl8rLtz3MnlueSaVF2yKlQA eK4ALzMw1Hqi9oGT8ySIeutEFfc1lkGmKTk6TyAEPOPRNdXA1I/33e4REnetAdfSbimBvlroQAi HXOf+VcULvnhK/J3ofuFs2Q2abK2PFa5IIP8rkV0Rmi5CQH4IgQsB53R/u7/WRtnxMmztojHM3g ysIb5b6V5ReNR9/lGYA5WKjCa1zBexS6IY3PrgyNYkiqEGPn13Yj/f5xa6sAAaoXs00bLQIYzwG W23jhIy590mRUhnXSgKyB9pjOY/admJmvuf3jWsTFKr85QffnOtEDGKd6TtLrRUS0uci87YHQTx TQhpA9jOG4l0Y+M/RWB X-Received: by 2002:a17:902:6905:b0:2b2:49a7:a5bd with SMTP id d9443c01a7336-2b5f9e770c5mr229435215ad.1.1777031983329; Fri, 24 Apr 2026 04:59:43 -0700 (PDT) Received: from localhost.localdomain ([1.226.165.54]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5fa9ff90dsm222858185ad.11.2026.04.24.04.59.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 24 Apr 2026 04:59:42 -0700 (PDT) From: Myeonghun Pak To: Biju Das Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Myeonghun Pak Subject: [PATCH] drm/renesas: rz-du: Fix MIPI DSI host leak on probe failure Date: Fri, 24 Apr 2026 20:59:00 +0900 Message-ID: <20260424115936.7930-1-mhun512@gmail.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" rzg2l_mipi_dsi_probe() registers the MIPI DSI host before allocating the DCS buffer. If dma_alloc_coherent() fails, probe returns -ENOMEM directly and leaves the host registered. The remove callback unregisters the host, but remove is only called after a successful probe. Add a local unwind path that unregisters the host before disabling runtime PM on the DCS buffer allocation failure path. Signed-off-by: Myeonghun Pak --- drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/d= rm/renesas/rz-du/rzg2l_mipi_dsi.c index 29f2b7d24f..309fae1459 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c @@ -1476,14 +1476,19 @@ static int rzg2l_mipi_dsi_probe(struct platform_dev= ice *pdev) =20 dsi->dcs_buf_virt =3D dma_alloc_coherent(dsi->host.dev, RZG2L_DCS_BUF_SIZ= E, &dsi->dcs_buf_phys, GFP_KERNEL); - if (!dsi->dcs_buf_virt) - return -ENOMEM; + if (!dsi->dcs_buf_virt) { + ret =3D -ENOMEM; + goto err_host_unregister; + } =20 return 0; =20 err_phy: dsi->info->dphy_exit(dsi); pm_runtime_put(dsi->dev); + goto err_pm_disable; +err_host_unregister: + mipi_dsi_host_unregister(&dsi->host); err_pm_disable: pm_runtime_disable(dsi->dev); return ret; --