The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/3] media: tuners: tda18271: fix error code handling in tda18271_attach()
@ 2024-04-16 11:45 Roman Smirnov
  2024-04-16 11:45 ` [PATCH 2/3] media: tuners: xc5000: fix error code handling in xc5000_attach() Roman Smirnov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Roman Smirnov @ 2024-04-16 11:45 UTC (permalink / raw)
  To: Michael Krufky, Mauro Carvalho Chehab, Jia-Ju Bai, Hans Verkuil
  Cc: Roman Smirnov, linux-media, linux-kernel, Sergey Shtylyov,
	lvc-project

tda18271_attach() uses the hybrid_tuner_request_state() macro.
It may return the error code -ENOMEM, but the function handle
the value 0 instead.

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

Fixes: b9302fa7ed97 ("media: tuners: fix error return code of hybrid_tuner_request_state()")
Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
---
 drivers/media/tuners/tda18271-fe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/tuners/tda18271-fe.c b/drivers/media/tuners/tda18271-fe.c
index a7e721baaa99..23432210f06a 100644
--- a/drivers/media/tuners/tda18271-fe.c
+++ b/drivers/media/tuners/tda18271-fe.c
@@ -1255,7 +1255,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
 					      hybrid_tuner_instance_list,
 					      i2c, addr, "tda18271");
 	switch (instance) {
-	case 0:
+	case -ENOMEM:
 		goto fail;
 	case 1:
 		/* new tuner instance */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-24 20:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16 11:45 [PATCH 1/3] media: tuners: tda18271: fix error code handling in tda18271_attach() Roman Smirnov
2024-04-16 11:45 ` [PATCH 2/3] media: tuners: xc5000: fix error code handling in xc5000_attach() Roman Smirnov
2024-04-16 18:58   ` Sergey Shtylyov
2024-04-16 11:45 ` [PATCH 3/3] media: tuners: tuner_simple: fix error code handling in simple_tuner_attach() Roman Smirnov
2024-04-16 18:31   ` Sergey Shtylyov
2024-04-16 18:32 ` [PATCH 1/3] media: tuners: tda18271: fix error code handling in tda18271_attach() Sergey Shtylyov
2024-04-24 18:06 ` [lvc-project] " Fedor Pchelkin
2024-04-24 20:20   ` Fedor Pchelkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox