All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: dvbdev: return -EINVAL on failure
@ 2024-10-28 14:21 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2024-10-28 14:21 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Arnd Bergmann, Hans Verkuil, Zhipeng Lu, Ricardo Ribalda,
	Dan Carpenter, linux-media, linux-kernel

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


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

only message in thread, other threads:[~2024-10-28 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28 14:21 [PATCH] media: dvbdev: return -EINVAL on failure Arnd Bergmann

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.