* [PATCH/RFC] [media] dvb-usb: Initialize ret in dvb_usb_adapter_frontend_init()
@ 2016-05-29 10:04 Geert Uytterhoeven
0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2016-05-29 10:04 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Arnd Bergmann, linux-media, Geert Uytterhoeven
drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function ‘dvb_usb_adapter_frontend_init’:
drivers/media/usb/dvb-usb/dvb-usb-dvb.c:323: warning: ‘ret’ is used uninitialized in this function
If num_frontends is zero, dvb_usb_adapter_frontend_init() will return an
uninitialized value. Initialize ret to -ENODEV to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Can num_frontends ever be zero?
drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
index 6477b04e95c748cc..2ecc7009588a25a2 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -271,7 +271,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
{
- int ret, i;
+ int ret = -ENODEV, i;
/* register all given adapter frontends */
for (i = 0; i < adap->props.num_frontends; i++) {
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-29 17:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-29 10:04 [PATCH/RFC] [media] dvb-usb: Initialize ret in dvb_usb_adapter_frontend_init() Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).