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 C423E15198D; Wed, 5 Feb 2025 14:02:56 +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=1738764176; cv=none; b=lW8jZBy3yxKWpvuFLO9Rk7jd7WQufJe8GCVsZT2uWv4fuBxXU7ofpL74U53pZSm+geQ3u21xak5NuelsqEBynoYvln0Wm4Z2Spjshzf2l1/piyu5UYif/pCNBZIbyyAziuzNSaE9WOwRl/s+Y/fiIxfgLCcIQrU9tJj3f0DSP+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738764176; c=relaxed/simple; bh=UbDmymL9tsfU1d2h2hVFjWqaJkg9wG/B+cupSZcH+n8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iyk0mqBPTGQ1+ZLdIvqApo9pty5v2MAFe431XE9MnbNJvBcsVoFxb/ChcdZI+2GFq0t3FCa/zsYLCXoNmL/yYV0NSL26EWPonUxoJ2qmGxsUpzpQ1ED0/Kkdxr/9Uvx9HjvIH+WTOZinroNYB99/ZXdLT6+USLe3OGs9Cttw0PY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=arZkuuid; 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="arZkuuid" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2966EC4CEDD; Wed, 5 Feb 2025 14:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738764176; bh=UbDmymL9tsfU1d2h2hVFjWqaJkg9wG/B+cupSZcH+n8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=arZkuuidIF/wAHx0jrGXCjy1oOWeX1N+C9ikq0WlQfA2urT77GI4pWKMHFaDgvL+U lrgOb/+J7JqWLvmzlI8t1elEEo1BPm/XEkI2kenvnbEFKj8S+tAhw+GeH8oJzOyNw9 golkZojMwqLPwP7rar+HvopiLpTvXp+mMMRR+X+Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stephen Boyd , Dmitry Baryshkov , Douglas Anderson , Abhinav Kumar , Sasha Levin Subject: [PATCH 6.13 054/623] drm/msm/dpu: check dpu_plane_atomic_print_state() for valid sspp Date: Wed, 5 Feb 2025 14:36:36 +0100 Message-ID: <20250205134458.296583434@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250205134456.221272033@linuxfoundation.org> References: <20250205134456.221272033@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abhinav Kumar [ Upstream commit 789384eb1437aed94155dc0eac8a8a6ba1baf578 ] Similar to the r_pipe sspp protect, add a check to protect the pipe state prints to avoid NULL ptr dereference for cases when the state is dumped without a corresponding atomic_check() where the pipe->sspp is assigned. Fixes: 31f7148fd370 ("drm/msm/dpu: move pstate->pipe initialization to dpu_plane_atomic_check") Reported-by: Stephen Boyd Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/67 Reviewed-by: Dmitry Baryshkov Tested-by: Douglas Anderson Tested-by: Stephen Boyd # sc7180-trogdor Patchwork: https://patchwork.freedesktop.org/patch/628404/ Link: https://lore.kernel.org/r/20241211-check-state-before-dump-v2-1-62647a501e8c@quicinc.com Signed-off-by: Abhinav Kumar Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 3ffac24333a2a..703e58901d53f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1335,12 +1335,15 @@ static void dpu_plane_atomic_print_state(struct drm_printer *p, drm_printf(p, "\tstage=%d\n", pstate->stage); - drm_printf(p, "\tsspp[0]=%s\n", pipe->sspp->cap->name); - drm_printf(p, "\tmultirect_mode[0]=%s\n", dpu_get_multirect_mode(pipe->multirect_mode)); - drm_printf(p, "\tmultirect_index[0]=%s\n", - dpu_get_multirect_index(pipe->multirect_index)); - drm_printf(p, "\tsrc[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->src_rect)); - drm_printf(p, "\tdst[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->dst_rect)); + if (pipe->sspp) { + drm_printf(p, "\tsspp[0]=%s\n", pipe->sspp->cap->name); + drm_printf(p, "\tmultirect_mode[0]=%s\n", + dpu_get_multirect_mode(pipe->multirect_mode)); + drm_printf(p, "\tmultirect_index[0]=%s\n", + dpu_get_multirect_index(pipe->multirect_index)); + drm_printf(p, "\tsrc[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->src_rect)); + drm_printf(p, "\tdst[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->dst_rect)); + } if (r_pipe->sspp) { drm_printf(p, "\tsspp[1]=%s\n", r_pipe->sspp->cap->name); -- 2.39.5