From: Mauro Carvalho Chehab Date: Fri, 27 Nov 2020 06:40:21 +0000 (+0100) Subject: media: gp8psk: initialize stats at power control logic X-Git-Tag: accepted/tizen/unified/20230118.172025~8355^2~233 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0ac1a26ed5943127cb0156148735f5f52a07075;p=platform%2Fkernel%2Flinux-rpi.git media: gp8psk: initialize stats at power control logic 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 Reported-by: Willem de Bruijn Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c index c07f46f..b4f661b 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) {