提交 d6cd978f 编写于 作者: Z Zhouyi Zhou 提交者: Helge Deller

video: fbdev: fbmem: fix pointer reference to null device field

In function do_remove_conflicting_framebuffers, if device is NULL, there
will be null pointer reference. The patch add a check to the if expression.
Signed-off-by: NZhouyi Zhou <zhouzhouyi@gmail.com>
Acked-by: NPaul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: NHelge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220210065824.368355-1-zhouzhouyi@gmail.com
上级 16a54d4e
......@@ -1579,7 +1579,7 @@ static void do_remove_conflicting_framebuffers(struct apertures_struct *a,
* If it's not a platform device, at least print a warning. A
* fix would add code to remove the device from the system.
*/
if (dev_is_platform(device)) {
if (device && dev_is_platform(device)) {
registered_fb[i]->forced_out = true;
platform_device_unregister(to_platform_device(device));
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册