All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Smirnov <r.smirnov@omp.ru>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: Roman Smirnov <r.smirnov@omp.ru>, <linux-media@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	<lvc-project@linuxtesting.org>
Subject: [PATCH 3/3] media: tuners: tuner_simple: fix error code handling in simple_tuner_attach()
Date: Tue, 16 Apr 2024 14:45:09 +0300	[thread overview]
Message-ID: <20240416114509.198069-3-r.smirnov@omp.ru> (raw)
In-Reply-To: <20240416114509.198069-1-r.smirnov@omp.ru>

simple_tuner_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/tuner-simple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/tuners/tuner-simple.c b/drivers/media/tuners/tuner-simple.c
index 8fb186b25d6a..713ce2455910 100644
--- a/drivers/media/tuners/tuner-simple.c
+++ b/drivers/media/tuners/tuner-simple.c
@@ -1089,7 +1089,7 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
 					      i2c_adap, i2c_addr,
 					      "tuner-simple");
 	switch (instance) {
-	case 0:
+	case -ENOMEM:
 		mutex_unlock(&tuner_simple_list_mutex);
 		return NULL;
 	case 1:
-- 
2.34.1


  parent reply	other threads:[~2024-04-16 11:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Roman Smirnov [this message]
2024-04-16 18:31   ` [PATCH 3/3] media: tuners: tuner_simple: fix error code handling in simple_tuner_attach() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416114509.198069-3-r.smirnov@omp.ru \
    --to=r.smirnov@omp.ru \
    --cc=baijiaju1990@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mchehab@kernel.org \
    --cc=s.shtylyov@omp.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.