projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42118c5
)
drm/arm/malidp: fix a possible null pointer dereference
author
Huai-Yuan Liu
<qq810974084@gmail.com>
Sun, 7 Apr 2024 06:30:53 +0000
(14:30 +0800)
committer
Liviu Dudau
<liviu.dudau@arm.com>
Fri, 12 Apr 2024 11:57:59 +0000
(12:57 +0100)
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@gmail.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link:
https://patchwork.freedesktop.org/patch/msgid/20240407063053.5481-1-qq810974084@gmail.com
drivers/gpu/drm/arm/malidp_mw.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/gpu/drm/arm/malidp_mw.c
b/drivers/gpu/drm/arm/malidp_mw.c
index 626709bec6f5ff125fa9de97c227a8c0eacb85bb..2577f0cef8fcda497efa91ed5dbce9c2a40587c7 100644
(file)
--- 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