Patch "drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-msm-dpu-check-for-valid-hw_pp-in-dpu_encoder_hel.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5d134f785e4d709538ed40d1536b75483158b2ae
Author: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>
Date:   Wed Jan 17 11:41:09 2024 -0800

    drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup
    
    [ Upstream commit 7f3d03c48b1eb6bc45ab20ca98b8b11be25f9f52 ]
    
    The commit 8b45a26f2ba9 ("drm/msm/dpu: reserve cdm blocks for writeback
    in case of YUV output") introduced a smatch warning about another
    conditional block in dpu_encoder_helper_phys_cleanup() which had assumed
    hw_pp will always be valid which may not necessarily be true.
    
    Lets fix the other conditional block by making sure hw_pp is valid
    before dereferencing it.
    
    Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Fixes: ae4d721ce100 ("drm/msm/dpu: add an API to reset the encoder related hw blocks")
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Patchwork: https://patchwork.freedesktop.org/patch/574878/
    Link: https://lore.kernel.org/r/20240117194109.21609-1-quic_abhinavk@xxxxxxxxxxx
    Signed-off-by: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 38d38f923df6..25245ef386db 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2053,7 +2053,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
 	}
 
 	/* reset the merge 3D HW block */
-	if (phys_enc->hw_pp->merge_3d) {
+	if (phys_enc->hw_pp && phys_enc->hw_pp->merge_3d) {
 		phys_enc->hw_pp->merge_3d->ops.setup_3d_mode(phys_enc->hw_pp->merge_3d,
 				BLEND_3D_NONE);
 		if (phys_enc->hw_ctl->ops.update_pending_flush_merge_3d)
@@ -2069,7 +2069,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
 	if (phys_enc->hw_wb)
 		intf_cfg.wb = phys_enc->hw_wb->idx;
 
-	if (phys_enc->hw_pp->merge_3d)
+	if (phys_enc->hw_pp && phys_enc->hw_pp->merge_3d)
 		intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx;
 
 	if (ctl->ops.reset_intf_cfg)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux