diff options
author | Joe Moriarty <joe.moriarty@oracle.com> | 2018-02-12 22:51:43 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-02-19 15:01:20 +0300 |
commit | a5ef65673667fc37ffa55884915f953cb5cc3b3e (patch) | |
tree | bae1bfcc065bd8a7757843b714b78375a3ea811a /drivers/gpu/drm/drm_edid.c | |
parent | 22a07038c0eaf4d1315a493ce66dcd255accba19 (diff) | |
download | linux-a5ef65673667fc37ffa55884915f953cb5cc3b3e.tar.xz |
drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
The Parfait (version 2.1.0) static code analysis tool found the
following NULL pointer derefernce problem.
- drivers/gpu/drm/drm_edid.c
The call to drm_cvt_mode() in function drm_mode_std() for the
HDTV hack resulted in the possibility of accessing a NULL pointer
if drm_mode_std() returned NULL. A check for this added right after
the call to drm_cvt_mode() in this particular area of code.
Signed-off-by: Joe Moriarty <joe.moriarty@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180212195144.98323-4-joe.moriarty@oracle.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index b1cb2627548f..a797bbf1cab8 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2083,6 +2083,8 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid, if (hsize == 1366 && vsize == 768 && vrefresh_rate == 60) { mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, false); + if (!mode) + return NULL; mode->hdisplay = 1366; mode->hsync_start = mode->hsync_start - 1; mode->hsync_end = mode->hsync_end - 1; |