mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
disp: msm: dsi: Nullify display modes after kfree
The 'display->modes' pointer must be set to NULL immediately after calling kfree on it to prevent potential double-free vulnerabilities or use-after-free issues. This change ensures robust memory management by clearing the pointer to previously freed memory, aligning with best practices for kernel memory deallocation. Change-Id: I4fd939bc6ee5f3d9c506f0c311a9400f366e7fd2 Signed-off-by: Vedant Yevale <vyevale@qti.qualcomm.com> (cherry picked from commit 1d3c5a477ea8f6aca1158209e1b87209c21c61f5)
This commit is contained in:
parent
0192aaa6cd
commit
8c29510d44
1 changed files with 3 additions and 1 deletions
|
|
@ -7168,8 +7168,10 @@ exit:
|
|||
rc = 0;
|
||||
|
||||
error:
|
||||
if (rc)
|
||||
if (rc) {
|
||||
kfree(display->modes);
|
||||
display->modes = NULL;
|
||||
}
|
||||
|
||||
mutex_unlock(&display->display_lock);
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue