projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
366d480
)
drm: Check if the allocation has succeeded before dereferencing newmode
author
Damien Lespiau
<damien.lespiau@intel.com>
Mon, 3 Mar 2014 23:59:07 +0000
(23:59 +0000)
committer
Daniel Vetter
<daniel.vetter@ffwll.ch>
Mon, 17 Mar 2014 10:23:07 +0000
(11:23 +0100)
We allocate memory in drm_display_mode_from_vic_index() and use it
without checking the pointer is valid. Fix that.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_edid.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/drm_edid.c
b/drivers/gpu/drm/drm_edid.c
index
f8d8a1d
..
f3cde90
100644
(file)
--- a/
drivers/gpu/drm/drm_edid.c
+++ b/
drivers/gpu/drm/drm_edid.c
@@
-2580,6
+2580,9
@@
drm_display_mode_from_vic_index(struct drm_connector *connector,
return NULL;
newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]);
+ if (!newmode)
+ return NULL;
+
newmode->vrefresh = 0;
return newmode;