]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/fbdev-sm712fb-fix-memory-frequency-by-avoiding-a-switch-case-fallthrough.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / queue-4.4 / fbdev-sm712fb-fix-memory-frequency-by-avoiding-a-switch-case-fallthrough.patch
1 From 9dc20113988b9a75ea6b3abd68dc45e2d73ccdab Mon Sep 17 00:00:00 2001
2 From: Yifeng Li <tomli@tomli.me>
3 Date: Tue, 2 Apr 2019 17:14:10 +0200
4 Subject: fbdev: sm712fb: fix memory frequency by avoiding a switch/case fallthrough
5
6 From: Yifeng Li <tomli@tomli.me>
7
8 commit 9dc20113988b9a75ea6b3abd68dc45e2d73ccdab upstream.
9
10 A fallthrough in switch/case was introduced in f627caf55b8e ("fbdev:
11 sm712fb: fix crashes and garbled display during DPMS modesetting"),
12 due to my copy-paste error, which would cause the memory clock frequency
13 for SM720 to be programmed to SM712.
14
15 Since it only reprograms the clock to a different frequency, it's only
16 a benign issue without visible side-effect, so it also evaded Sudip
17 Mukherjee's code review and regression tests. scripts/checkpatch.pl
18 also failed to discover the issue, possibly due to nested switch
19 statements.
20
21 This issue was found by Stephen Rothwell by building linux-next with
22 -Wimplicit-fallthrough.
23
24 Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
25 Fixes: f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
26 Signed-off-by: Yifeng Li <tomli@tomli.me>
27 Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
28 Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
29 Cc: Kees Cook <keescook@chromium.org>
30 Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32
33 ---
34 drivers/video/fbdev/sm712fb.c | 1 +
35 1 file changed, 1 insertion(+)
36
37 --- a/drivers/video/fbdev/sm712fb.c
38 +++ b/drivers/video/fbdev/sm712fb.c
39 @@ -898,6 +898,7 @@ static int smtc_blank(int blank_mode, st
40 case 0x712:
41 smtc_seqw(0x6a, 0x16);
42 smtc_seqw(0x6b, 0x02);
43 + break;
44 case 0x720:
45 smtc_seqw(0x6a, 0x0d);
46 smtc_seqw(0x6b, 0x02);