Patch "drm/arm/malidp: fix a possible null pointer dereference" has been added to the 6.9-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/arm/malidp: fix a possible null pointer dereference

to the 6.9-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-arm-malidp-fix-a-possible-null-pointer-dereferen.patch
and it can be found in the queue-6.9 subdirectory.

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



commit beaf2c385327a4eb3f8fe5137f1684fb303ff158
Author: Huai-Yuan Liu <qq810974084@xxxxxxxxx>
Date:   Sun Apr 7 14:30:53 2024 +0800

    drm/arm/malidp: fix a possible null pointer dereference
    
    [ Upstream commit a1f95aede6285dba6dd036d907196f35ae3a11ea ]
    
    In malidp_mw_connector_reset, new memory is allocated with kzalloc, but
    no check is performed. In order to prevent null pointer dereferencing,
    ensure that mw_state is checked before calling
    __drm_atomic_helper_connector_reset.
    
    Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector")
    Signed-off-by: Huai-Yuan Liu <qq810974084@xxxxxxxxx>
    Signed-off-by: Liviu Dudau <liviu.dudau@xxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240407063053.5481-1-qq810974084@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c
index 626709bec6f5f..2577f0cef8fcd 100644
--- a/drivers/gpu/drm/arm/malidp_mw.c
+++ b/drivers/gpu/drm/arm/malidp_mw.c
@@ -72,7 +72,10 @@ static void malidp_mw_connector_reset(struct drm_connector *connector)
 		__drm_atomic_helper_connector_destroy_state(connector->state);
 
 	kfree(connector->state);
-	__drm_atomic_helper_connector_reset(connector, &mw_state->base);
+	connector->state = NULL;
+
+	if (mw_state)
+		__drm_atomic_helper_connector_reset(connector, &mw_state->base);
 }
 
 static enum drm_connector_status




[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