All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: cx24120: Add retval check for cx24120_message_send()
@ 2023-06-02  8:55 Daniil Dulov
  0 siblings, 0 replies; only message in thread
From: Daniil Dulov @ 2023-06-02  8:55 UTC (permalink / raw)
  To: Jemma Denson
  Cc: Daniil Dulov, Patrick Boettcher, Mauro Carvalho Chehab,
	linux-media, linux-kernel, lvc-project

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>
---
 drivers/media/dvb-frontends/cx24120.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c
index 2464b63fe0cf..307efef263f2 100644
--- a/drivers/media/dvb-frontends/cx24120.c
+++ b/drivers/media/dvb-frontends/cx24120.c
@@ -972,7 +972,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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-02  9:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02  8:55 [PATCH] media: cx24120: Add retval check for cx24120_message_send() Daniil Dulov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.