Skip to content

Commit

Permalink
media: gp8psk: initialize stats at power control logic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mchehab committed Nov 27, 2020
1 parent 711561a commit d0ac1a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/usb/dvb-usb/gp8psk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d0ac1a2

Please sign in to comment.