Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

YueHaibing and committed by
Bartlomiej Zolnierkiewicz
f4029844 10993504

+2
+2
drivers/video/fbdev/core/fbmon.c
··· 978 978 get_monspecs(edid, specs); 979 979 980 980 specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs); 981 + if (!specs->modedb) 982 + return; 981 983 982 984 /* 983 985 * Workaround for buggy EDIDs that sets that the first