diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-02-08 21:24:49 +0300 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2019-02-08 21:24:49 +0300 |
commit | f40298444e8ca13789dc002ffb269c343aadfb87 (patch) | |
tree | 3866e789f0c2a86fdb18d25ad883a03f2cb0b9ce /drivers/video | |
parent | 10993504d647356196a04b3022d645ec92e00159 (diff) | |
download | linux-f40298444e8ca13789dc002ffb269c343aadfb87.tar.xz |
video: fbdev: Fix potential NULL pointer dereference
There is a potential NULL pointer dereference in case
fb_create_modedb() fails and returns NULL.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/core/fbmon.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c index dd3128990776..3558a70a6664 100644 --- a/drivers/video/fbdev/core/fbmon.c +++ b/drivers/video/fbdev/core/fbmon.c @@ -978,6 +978,8 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) get_monspecs(edid, specs); specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs); + if (!specs->modedb) + return; /* * Workaround for buggy EDIDs that sets that the first |