Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 DBF5A3FCB3A; Sat, 12 Sep 2026 08:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789202102; cv=none; b=Uq6jKHIiLWNRI0YEgtsoLfY8V5Dzp5MOh8OYYNEP9jm5EWqZx1uwJjOnt+G+LHtCmvQmgZzEpLnxQNFTKR08xLAxr6LvA5fgiem9XZls01MGiqpoEkRnJNhm95aTSXggPsHowcMFdvCmVA0hJIY8PKxlMlumfxDksdP7kfy51TI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789202102; c=relaxed/simple; bh=YKHSFPRjrpr+hCi493WZjLxKpaE2a0paV70M7fsqyik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F16iTWUqh+OCgSYC6KLgDHBEpC8Rfvs+LllfjBHzj+6zri+HLV4+cBjWKlZA0oCc2sfBr9QP9v6vTRDJ/Oh+/pNRWNIbZ7Jl36lcdvTe7oymoJxONaL0cM8yNavOaMODRz1b496R8q779NRxM96Zgrh+INzy4gswZ8tG4JCuvFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qsrt8+/K; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qsrt8+/K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A3531F000FF; Sat, 12 Sep 2026 08:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789202100; bh=TlFSvk16/+eCgHDiNuJOBAUFjZ5mwBY0WUQC2TL1Jas=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qsrt8+/K9hX4F8O1xe2tvLvmEyI527nem1xJpMgg+ISEgNY13n0cN/cOVclEcc/hQ S+dkUFsmt5yvE4iSovcD+xxkBlsmYfm8mN7UrRGeKXPfbY2mLZHNK9TQGyWCFlQE7b utqeK7CdWWl49p2TawvOfVH1VDye+jrp5Tjj27t0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jernej Skrabec , Chen-Yu Tsai , Sasha Levin Subject: [PATCH 7.2 1132/1815] drm/sun4i: crtc: Propagate layer initialization error Date: Sat, 12 Sep 2026 08:48:02 +0200 Message-ID: <20260912065715.596730822@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jernej Skrabec [ Upstream commit 7061ff05ed4a3cf16e83f7e3ad09cbd212508a32 ] sun4i_crtc_init() returns plain NULL when layer initialization fails, while all its other error paths return an error pointer. The only caller, sun4i_tcon_bind(), checks the result with IS_ERR() and happily continues with tcon->crtc set to NULL. sun4i_rgb_init() and sun4i_lvds_init() then dereference it in drm_crtc_mask(), which oopses. Return the error pointer instead. Fixes: dcd215801b02 ("drm/sun4i: Drop primary layer pointer from sun4i_drv") Signed-off-by: Jernej Skrabec Acked-by: Chen-Yu Tsai Link: https://patch.msgid.link/b26a0d427d9dfae9c82e3ca90a67d24d8ece5a28.1785772659.git.jernej.skrabec@gmail.com Signed-off-by: Chen-Yu Tsai Signed-off-by: Sasha Levin --- drivers/gpu/drm/sun4i/sun4i_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index c2f7f69baf75a..3fa1f4fda0f0d 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -208,7 +208,7 @@ struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm, planes = sunxi_engine_layers_init(drm, engine); if (IS_ERR(planes)) { dev_err(drm->dev, "Couldn't create the planes\n"); - return NULL; + return ERR_CAST(planes); } /* find primary and cursor planes for drm_crtc_init_with_planes */ -- 2.53.0