From mboxrd@z Thu Jan 1 00:00:00 1970 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 03BFA377A98 for ; Mon, 5 Oct 2026 08:06:14 +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=1791187576; cv=none; b=HV371rlvINIeDCSejPEI5iFxB3SE9CVXsnmeEd1gK+RfUvHeGh3+yTLnR0ddhrI6VaCWF9rd5R9qMIA5Mix2mzTGX22cXC3edQq2DR4/+J83gpALkVJMsKs0CEouTSqFvzZmn8EYV1w77dIlj7KSclfSz4aWYRZb5eTtaWP+NNk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791187576; c=relaxed/simple; bh=w/a6dP8mKV87tmYvaqZdSliGse4B1GDg9HZkq2PmH9w=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=hPYNR/v/WmzHf7HJ9SsLiTHrDFk8zg1Y8NXPZ1MewvdcOqn/GKi5aANMTmD8IXG16tfl38HlORlzVvHz5PZ1+PKx77wLlhkXJQOAkdXjmUHEZ0D2qObbLhl0gIstaxqg7hAKW4DjIl8PkQTeGn/xx4xFDelh39R2LTCgMh/RfMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Fuuo4EyR; 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="Fuuo4EyR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17EA01F000FF; Mon, 5 Oct 2026 08:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791187574; bh=dCRNDGoi0R77dgZ+OTWPfLgiwscBUO8mk7mzXXO7Yic=; h=Subject:To:Cc:From:Date; b=Fuuo4EyRWxUpTgfFo0SPEmHkKrNwZRbgMc8OYdc/73wcMNVMavBgK9X+J79/aGg9z zDkw+Hj7Fe+XO/MfI2hHSQNPXj9po9D7Z3YM8ow/uENrvAPDkCRGmDtTkvleboc1AW 59w4CTSW42JwMFh+Tt6QyCu7hkelNsX2i/YHYY6g= Subject: FAILED: patch "[PATCH] drm/amd/display: check dc_state_create_copy() for NULL in" failed to apply to 5.15-stable tree To: yijiangshan@kylinos.cn,alexander.deucher@amd.com,daniel.wheeler@amd.com,george.zhang@amd.com Cc: From: Date: Mon, 05 Oct 2026 10:05:58 +0200 Message-ID: <2026100558-hardness-compare-fb18@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 015e72cde567d2450e282c2790773463156b2d0a # git commit -s git send-email --to '' --in-reply-to '2026100558-hardness-compare-fb18@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 015e72cde567d2450e282c2790773463156b2d0a Mon Sep 17 00:00:00 2001 From: Jiangshan Yi Date: Fri, 4 Sep 2026 17:18:17 +0800 Subject: [PATCH] drm/amd/display: check dc_state_create_copy() for NULL in dm_suspend dc_state_create_copy() can return NULL on allocation failure. dm_suspend() only conditionally skips dm_gpureset_toggle_interrupts() and continues execution, returning success. dm_resume() then dereferences the NULL cached_dc_state in link_enc_cfg_copy() and the following dc_state->stream_count loop, crashing during GPU reset recovery. Return -ENOMEM immediately if the copy fails, so the caller aborts suspend instead of leaving a NULL cached state for resume. Fixes: 8092aa3ab8f7 ("drm/amd/display: Add null checker before passing variables") Reviewed-by: George Zhang Signed-off-by: Jiangshan Yi Tested-by: Dan Wheeler Signed-off-by: Alex Deucher (cherry picked from commit 84b6d7932fdd2857795a257f9f258562a3cddcab) Cc: stable@vger.kernel.org diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 91fdf3de7202..e0485d76dc59 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1582,9 +1582,14 @@ static int dm_suspend(struct amdgpu_ip_block *ip_block) dc_allow_idle_optimizations(adev->dm.dc, false); dm->cached_dc_state = dc_state_create_copy(dm->dc->current_state); + if (!dm->cached_dc_state) { + drm_err(adev_to_drm(adev), + "Failed to allocate cached DC state during suspend\n"); + mutex_unlock(&dm->dc_lock); + return -ENOMEM; + } - if (dm->cached_dc_state) - dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false); + dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false); res = amdgpu_dm_commit_zero_streams(dm->dc); if (res != DC_OK) {