lkml.org 
[lkml]   [2014]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fbdev: fix possible NULL pointer derefernce
The spec->modedb can be NULL by fb_create_modedb().

And also smatch says:
drivers/video/fbdev/core/fbmon.c:975 fb_edid_to_monspecs() error:
potential null dereference 'specs->modedb'.
(fb_create_modedb returns null)

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
drivers/video/fbdev/core/fbmon.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index c204ebe..db274ca 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -966,6 +966,9 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)

specs->modedb = fb_create_modedb(edid, &specs->modedb_len);

+ if (!specs->modedb)
+ return;
+
/*
* Workaround for buggy EDIDs that sets that the first
* detailed timing is preferred but has not detailed
--
1.7.4.4


\
 
 \ /
  Last update: 2014-04-16 12:21    [W:0.033 / U:0.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site