All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: gp8psk: initialize stats at power control logic
@ 2020-11-27  6:46 Mauro Carvalho Chehab
  2020-11-27 14:20 ` Willem de Bruijn
  0 siblings, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2020-11-27  6:46 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: linuxarm, mauro.chehab, Mauro Carvalho Chehab,
	Mauro Carvalho Chehab, linux-kernel, syzbot, Willem de Bruijn

As reported on:
	https://lore.kernel.org/linux-media/20190627222020.45909-1-willemdebruijn.kernel@gmail.com/

if gp8psk_usb_in_op() returns an error, the status var is not
initialized. Yet, this var is used later on, in order to
identify:
	- if the device was already started;
	- if firmware has loaded;
	- if the LNBf was powered on.

Using status = 0 seems to ensure that everything will be
properly powered up.

So, instead of the proposed solution, let's just set
status = 0.

Reported-by: syzbot <syzkaller@googlegroups.com>
Reported-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/media/usb/dvb-usb/gp8psk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c
index c07f46f5176e..b4f661bb5648 100644
--- a/drivers/media/usb/dvb-usb/gp8psk.c
+++ b/drivers/media/usb/dvb-usb/gp8psk.c
@@ -182,7 +182,7 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d)
 
 static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff)
 {
-	u8 status, buf;
+	u8 status = 0, buf;
 	int gp_product_id = le16_to_cpu(d->udev->descriptor.idProduct);
 
 	if (onoff) {
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-01  2:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  6:46 [PATCH] media: gp8psk: initialize stats at power control logic Mauro Carvalho Chehab
2020-11-27 14:20 ` Willem de Bruijn
2020-11-30  9:44   ` Mauro Carvalho Chehab
2020-11-30 16:04     ` VDRU VDRU
2020-11-30 17:09       ` Mauro Carvalho Chehab
2020-12-01  2:07         ` VDRU VDRU

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.