From mboxrd@z Thu Jan 1 00:00:00 1970 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 5530934DB48; Fri, 21 Nov 2025 13:37:33 +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=1763732253; cv=none; b=Gjwf9vAkoPDsWkzXmqzJIUi3IE4R9MstFYtbM/Qq9b9Vm8gj8roO2wFygS3H2F1tvW/ZQLN7bkUHb+0au0dGY39oSWkYfw4atWpkCg0D2DiymsPQe3udYZnfIOJXWvF2a4PyWzTnfhypsSZMZvYQl6/4P8LaNzS13PylSp1EjTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763732253; c=relaxed/simple; bh=Qhfqf2g3xGacUiWwxrdZHt4MyQRIcbG4kZqUWkjMx9Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kx1tYCY9cpxuGrNA5+n7xTN7MKRTHONej4tXC+fJeihzfWOLlWdj4LXtV1mjvuchTmBgISmlMRhcugv/ADITtkrklhIxhCgAMblgWT7Sme2Z+mcwQn7p5PMY0WnrMRDDMbrHzhPq3c5gaNxMNY/HzXqsZCTnqehOrYn8Uz2VIJM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rQsfPugX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rQsfPugX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8D58C4CEF1; Fri, 21 Nov 2025 13:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763732253; bh=Qhfqf2g3xGacUiWwxrdZHt4MyQRIcbG4kZqUWkjMx9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rQsfPugXOskOpC5eGnFvWZneLzPmVr6+IXIONfMA+H/jesxGsENfCf94N36A21OrJ jHNyUop/cANju3inB+ryzRGpSTrOd6FIMsC7gG9xdrzC1g6xXEq3a8Ddarut5Pd3y2 6wbfpNMtMx3InZ96l191Sefcj4dQ5bQh/ihiQ86Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Zimmermann , Dan Carpenter , Melissa Wen , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, Javier Martinez Canillas , Sasha Levin Subject: [PATCH 6.6 055/529] drm/sysfb: Do not dereference NULL pointer in plane reset Date: Fri, 21 Nov 2025 14:05:54 +0100 Message-ID: <20251121130232.974523162@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130230.985163914@linuxfoundation.org> References: <20251121130230.985163914@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Zimmermann [ Upstream commit 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70 ] The plane state in __drm_gem_reset_shadow_plane() can be NULL. Do not deref that pointer, but forward NULL to the other plane-reset helpers. Clears plane->state to NULL. v2: - fix typo in commit description (Javier) Signed-off-by: Thomas Zimmermann Fixes: b71565022031 ("drm/gem: Export implementation of shadow-plane helpers") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/dri-devel/aPIDAsHIUHp_qSW4@stanley.mountain/ Cc: Thomas Zimmermann Cc: Melissa Wen Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Simona Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.15+ Reviewed-by: Javier Martinez Canillas Link: https://patch.msgid.link/20251017091407.58488-1-tzimmermann@suse.de [ removed drm_format_conv_state_init() call ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_gem_atomic_helper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/drm_gem_atomic_helper.c +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c @@ -301,7 +301,11 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_pla void __drm_gem_reset_shadow_plane(struct drm_plane *plane, struct drm_shadow_plane_state *shadow_plane_state) { - __drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base); + if (shadow_plane_state) { + __drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base); + } else { + __drm_atomic_helper_plane_reset(plane, NULL); + } } EXPORT_SYMBOL(__drm_gem_reset_shadow_plane);