Skip to content

Commit

Permalink
media: cx24120: Add retval check for cx24120_message_send()
Browse files Browse the repository at this point in the history
[ Upstream commit 96002c0 ]

If cx24120_message_send() returns error, we should keep local struct
unchanged.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 5afc9a2 ("[media] Add support for TechniSat Skystar S2")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Daniil Dulov authored and gregkh committed Sep 13, 2023
1 parent 2b6e20e commit a96892a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/dvb-frontends/cx24120.c
Expand Up @@ -973,7 +973,9 @@ static void cx24120_set_clock_ratios(struct dvb_frontend *fe)
cmd.arg[8] = (clock_ratios_table[idx].rate >> 8) & 0xff;
cmd.arg[9] = (clock_ratios_table[idx].rate >> 0) & 0xff;

cx24120_message_send(state, &cmd);
ret = cx24120_message_send(state, &cmd);
if (ret != 0)
return;

/* Calculate ber window rates for stat work */
cx24120_calculate_ber_window(state, clock_ratios_table[idx].rate);
Expand Down

0 comments on commit a96892a

Please sign in to comment.