diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2018-04-06 17:23:23 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-04-09 08:56:51 +0200 |
commit | 395a0f57c5f30dd6e3967abec4510ab1de562574 (patch) | |
tree | e10ed3a26b78589d1cbd4b83c24437ee23039562 /drivers/video | |
parent | 5d4047e777f896d1390bb79cd6fb60a845831aa8 (diff) | |
download | barebox-395a0f57c5f30dd6e3967abec4510ab1de562574.tar.gz barebox-395a0f57c5f30dd6e3967abec4510ab1de562574.tar.xz |
fb: reject enable request when framebuffer has no mode
If no display is connected or the display modes are incompatible with
the scanout hardware we might end up with a registered framebuffer with
no modes. Trying to enable such a framebuffer will blow up with NULL
ptr dereferences in various places, so just don't do it.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/fb.c b/drivers/video/fb.c index 5e829e832d..c9d184d502 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -124,6 +124,9 @@ static int fb_enable_set(struct param_d *param, void *priv) struct fb_info *info = priv; int enable; + if (!info->mode) + return -EINVAL; + enable = info->p_enable; if (enable) |