All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] tda18271: add missing result checking of tda18271_lookup_map()
@ 2024-02-16 16:01 Karina Yankevich
  0 siblings, 0 replies; only message in thread
From: Karina Yankevich @ 2024-02-16 16:01 UTC (permalink / raw)
  To: Michael Krufky
  Cc: Karina Yankevich, Mauro Carvalho Chehab, linux-media,
	linux-kernel, Sergey Shtylyov, lvc-project

tda18271_lookup_map() may return negative error code, but
tda18271c2_rf_tracking_filters_correction() doesn't check it
as the other callers.

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Karina Yankevich <k.yankevich@omp.ru>
---
 drivers/media/tuners/tda18271-fe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/tuners/tda18271-fe.c b/drivers/media/tuners/tda18271-fe.c
index f0371d004b36..ff5b22134414 100644
--- a/drivers/media/tuners/tda18271-fe.c
+++ b/drivers/media/tuners/tda18271-fe.c
@@ -279,7 +279,9 @@ static int tda18271c2_rf_tracking_filters_correction(struct dvb_frontend *fe,
 	if (approx > 255)
 		approx = 255;
 
-	tda18271_lookup_map(fe, RF_CAL_DC_OVER_DT, &freq, &dc_over_dt);
+	ret = tda18271_lookup_map(fe, RF_CAL_DC_OVER_DT, &freq, &dc_over_dt);
+	if (tda_fail(ret))
+		goto fail;
 
 	/* calculate temperature compensation */
 	rfcal_comp = dc_over_dt * (s32)(tm_current - priv->tm_rfcal) / 1000;
-- 
2.25.1


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

only message in thread, other threads:[~2024-02-16 16:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 16:01 [PATCH] [media] tda18271: add missing result checking of tda18271_lookup_map() Karina Yankevich

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.