1 From foo@baz Sat Jul 28 10:14:31 CEST 2018
2 From: Hans Verkuil <hverkuil@xs4all.nl>
3 Date: Sat, 7 Apr 2018 05:38:52 -0400
4 Subject: media: cec: fix smatch error
6 From: Hans Verkuil <hverkuil@xs4all.nl>
8 [ Upstream commit b66d448487a478c203368f2b72d7d9156a01f6be ]
10 drivers/media/cec/cec-pin-error-inj.c:231
11 cec_pin_error_inj_parse_line() error: uninitialized symbol 'pos'.
13 The tx-add-bytes command didn't check for the presence of an argument, and
14 also didn't check that it was > 0.
16 This should fix this error.
18 Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
19 Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
20 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 drivers/media/cec/cec-pin-error-inj.c | 10 ++++++----
24 1 file changed, 6 insertions(+), 4 deletions(-)
26 --- a/drivers/media/cec/cec-pin-error-inj.c
27 +++ b/drivers/media/cec/cec-pin-error-inj.c
28 @@ -204,16 +204,18 @@ bool cec_pin_error_inj_parse_line(struct
29 mode_mask = CEC_ERROR_INJ_MODE_MASK << mode_offset;
30 arg_idx = cec_error_inj_cmds[i].arg_idx;
32 - if (mode_offset == CEC_ERROR_INJ_RX_ARB_LOST_OFFSET ||
33 - mode_offset == CEC_ERROR_INJ_TX_ADD_BYTES_OFFSET)
36 if (mode_offset == CEC_ERROR_INJ_RX_ARB_LOST_OFFSET) {
42 + } else if (mode_offset == CEC_ERROR_INJ_TX_ADD_BYTES_OFFSET) {
43 + if (!has_pos || !pos)
48 if (arg_idx >= 0 && is_bit_pos) {
49 if (!has_pos || pos >= 160)