mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Hans Verkuil <hverkuil@xs4all.nl>,
	Zhipeng Lu <alexious@zju.edu.cn>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] media: dvbdev: return -EINVAL on failure
Date: Mon, 28 Oct 2024 14:21:03 +0000	[thread overview]
Message-ID: <20241028142107.737053-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

The dvb_register_device() function can return an uninitialized
error code:

drivers/media/dvb-core/dvbdev.c:554:10: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
  554 |                 return ret;
      |                        ^~~

Change this to -EINVAL as in the other half of the #ifdef block.

Fixes: 972e63e895ab ("media: dvbdev: prevent the risk of out of memory access")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/dvb-core/dvbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 78f46cb47c84..8c8dc7bbc59b 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -551,7 +551,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
 		kfree(dvbdev);
 		*pdvbdev = NULL;
 		mutex_unlock(&dvbdev_register_lock);
-		return ret;
+		return -EINVAL;
 	}
 #endif
 	dvbdev->minor = minor;
-- 
2.39.5


                 reply	other threads:[~2024-10-28 14:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20241028142107.737053-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=alexious@zju.edu.cn \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®