diff options
| author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-11-27 07:40:21 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-06 14:48:38 +0100 |
| commit | 28a29e3a658a444f34eabcc788098a97c81b4237 (patch) | |
| tree | ff206270085f839aff58a4fcfa36e06cdc585b2c | |
| parent | 750627d36f84bc3880d9059b5afa5207a2ddeb43 (diff) | |
| download | linux-28a29e3a658a444f34eabcc788098a97c81b4237.tar.gz linux-28a29e3a658a444f34eabcc788098a97c81b4237.tar.bz2 linux-28a29e3a658a444f34eabcc788098a97c81b4237.zip | |
media: gp8psk: initialize stats at power control logic
commit d0ac1a26ed5943127cb0156148735f5f52a07075 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/media/usb/dvb-usb/gp8psk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c index 1282f701f185..ac8b8bf6ee1d 100644 --- a/drivers/media/usb/dvb-usb/gp8psk.c +++ b/drivers/media/usb/dvb-usb/gp8psk.c @@ -182,7 +182,7 @@ out_rel_fw: 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) { |
