]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: cx24120: Add retval check for cx24120_message_send()
authorDaniil Dulov <d.dulov@aladdin.ru>
Fri, 2 Jun 2023 08:55:01 +0000 (01:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:57 +0000 (10:46 +0200)
[ Upstream commit 96002c0ac824e1773d3f706b1f92e2a9f2988047 ]

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

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

Fixes: 5afc9a25be8d ("[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>
drivers/media/dvb-frontends/cx24120.c

index 7f11dcc94d854c08bbe4bd5637790bf9517ab1da..869fb1a9ddf385c4ccc3af4b84559c28af419c93 100644 (file)
@@ -980,7 +980,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);