Commit 36ac969
media: adv7842: Avoid possible out-of-bounds array accesses in adv7842_cp_log_status()
commit 8163419e3e05d71dcfa8fb49c8fdf8d76908fe51 upstream.
It's possible for cp_read() and hdmi_read() to return -EIO. Those
values are further used as indexes for accessing arrays.
Fix that by checking return values where it's needed.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: a89bcd4 ("[media] adv7842: add new video decoder driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>1 parent eb56929 commit 36ac969
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2661 | 2661 | | |
2662 | 2662 | | |
2663 | 2663 | | |
| 2664 | + | |
2664 | 2665 | | |
2665 | 2666 | | |
2666 | 2667 | | |
| |||
2783 | 2784 | | |
2784 | 2785 | | |
2785 | 2786 | | |
| 2787 | + | |
2786 | 2788 | | |
2787 | | - | |
| 2789 | + | |
2788 | 2790 | | |
2789 | 2791 | | |
2790 | 2792 | | |
| |||
2814 | 2816 | | |
2815 | 2817 | | |
2816 | 2818 | | |
| 2819 | + | |
2817 | 2820 | | |
2818 | | - | |
| 2821 | + | |
2819 | 2822 | | |
2820 | 2823 | | |
2821 | 2824 | | |
| |||
0 commit comments