]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.129/video-fbdev-pxafb-clear-allocated-memory-for-video-modes.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.129 / video-fbdev-pxafb-clear-allocated-memory-for-video-modes.patch
1 From foo@baz Fri Sep 21 09:36:02 CEST 2018
2 From: Daniel Mack <daniel@zonque.org>
3 Date: Tue, 24 Jul 2018 19:11:25 +0200
4 Subject: video: fbdev: pxafb: clear allocated memory for video modes
5
6 From: Daniel Mack <daniel@zonque.org>
7
8 [ Upstream commit b951d80aaf224b1f774e10def672f5e37488e4ee ]
9
10 When parsing the video modes from DT properties, make sure to zero out
11 memory before using it. This is important because not all fields in the mode
12 struct are explicitly initialized, even though they are used later on.
13
14 Fixes: 420a488278e86 ("video: fbdev: pxafb: initial devicetree conversion")
15 Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
16 Signed-off-by: Daniel Mack <daniel@zonque.org>
17 Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
18 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 drivers/video/fbdev/pxafb.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
23
24 --- a/drivers/video/fbdev/pxafb.c
25 +++ b/drivers/video/fbdev/pxafb.c
26 @@ -2128,8 +2128,8 @@ static int of_get_pxafb_display(struct d
27 return -EINVAL;
28
29 ret = -ENOMEM;
30 - info->modes = kmalloc_array(timings->num_timings,
31 - sizeof(info->modes[0]), GFP_KERNEL);
32 + info->modes = kcalloc(timings->num_timings, sizeof(info->modes[0]),
33 + GFP_KERNEL);
34 if (!info->modes)
35 goto out;
36 info->num_modes = timings->num_timings;