Patch "drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc" has been added to the 5.16-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: invalid parameter check in dpu_setup_dspp_pcc

to the 5.16-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-invalid-parameter-check-in-dpu_setup_dsp.patch
and it can be found in the queue-5.16 subdirectory.

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



commit c981372ea922a87ddd61f6c1e55c9cd814430818
Author: José Expósito <jose.exposito89@xxxxxxxxx>
Date:   Sun Jan 9 20:24:31 2022 +0100

    drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc
    
    [ Upstream commit 170b22234d5495f5e0844246e23f004639ee89ba ]
    
    The function performs a check on the "ctx" input parameter, however, it
    is used before the check.
    
    Initialize the "base" variable after the sanity check to avoid a
    possible NULL pointer dereference.
    
    Fixes: 4259ff7ae509e ("drm/msm/dpu: add support for pcc color block in dpu driver")
    Addresses-Coverity-ID: 1493866 ("Null pointer dereference")
    Signed-off-by: José Expósito <jose.exposito89@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220109192431.135949-1-jose.exposito89@xxxxxxxxx
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
index a98e964c3b6fa..355894a3b48c3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
@@ -26,9 +26,16 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx,
 		struct dpu_hw_pcc_cfg *cfg)
 {
 
-	u32 base = ctx->cap->sblk->pcc.base;
+	u32 base;
 
-	if (!ctx || !base) {
+	if (!ctx) {
+		DRM_ERROR("invalid ctx %pK\n", ctx);
+		return;
+	}
+
+	base = ctx->cap->sblk->pcc.base;
+
+	if (!base) {
 		DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
 		return;
 	}



[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