lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241028142107.737053-1-arnd@kernel.org>
Date: Mon, 28 Oct 2024 14:21:03 +0000
From: Arnd Bergmann <arnd@...nel.org>
To: Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>,
	Hans Verkuil <hverkuil@...all.nl>,
	Zhipeng Lu <alexious@....edu.cn>,
	Ricardo Ribalda <ribalda@...omium.org>,
	Dan Carpenter <dan.carpenter@...aro.org>,
	linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] media: dvbdev: return -EINVAL on failure

From: Arnd Bergmann <arnd@...db.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@...db.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ