[5/5] dvb-usb/dvb-usb-urb.c: initialize actlen to 0
diff mbox series

Message ID 20191112092228.15800-6-hverkuil-cisco@xs4all.nl
State New
Headers show
Series
  • Fix various syzbot errors
Related show

Commit Message

Hans Verkuil Nov. 12, 2019, 9:22 a.m. UTC
This fixes a syzbot failure since actlen could be uninitialized,
but it was still used.

Syzbot link:

https://syzkaller.appspot.com/bug?extid=6bf9606ee955b646c0e1

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-and-tested-by: syzbot+6bf9606ee955b646c0e1@syzkaller.appspotmail.com
CC: Sean Young <sean@mess.org>
---
 drivers/media/usb/dvb-usb/dvb-usb-urb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Young Nov. 12, 2019, 9:53 a.m. UTC | #1
On Tue, Nov 12, 2019 at 10:22:28AM +0100, Hans Verkuil wrote:
> This fixes a syzbot failure since actlen could be uninitialized,
> but it was still used.
> 
> Syzbot link:
> 
> https://syzkaller.appspot.com/bug?extid=6bf9606ee955b646c0e1
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Reported-and-tested-by: syzbot+6bf9606ee955b646c0e1@syzkaller.appspotmail.com
> CC: Sean Young <sean@mess.org>

Thanks, looks good.

Acked-by: Sean Young <sean@mess.org>

Sean

> ---
>  drivers/media/usb/dvb-usb/dvb-usb-urb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/dvb-usb/dvb-usb-urb.c b/drivers/media/usb/dvb-usb/dvb-usb-urb.c
> index c1b4e94a37f8..2aabf90d8697 100644
> --- a/drivers/media/usb/dvb-usb/dvb-usb-urb.c
> +++ b/drivers/media/usb/dvb-usb/dvb-usb-urb.c
> @@ -12,7 +12,7 @@
>  int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
>  	u16 rlen, int delay_ms)
>  {
> -	int actlen,ret = -ENOMEM;
> +	int actlen = 0, ret = -ENOMEM;
>  
>  	if (!d || wbuf == NULL || wlen == 0)
>  		return -EINVAL;
> -- 
> 2.24.0

Patch
diff mbox series

diff --git a/drivers/media/usb/dvb-usb/dvb-usb-urb.c b/drivers/media/usb/dvb-usb/dvb-usb-urb.c
index c1b4e94a37f8..2aabf90d8697 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-urb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-urb.c
@@ -12,7 +12,7 @@ 
 int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
 	u16 rlen, int delay_ms)
 {
-	int actlen,ret = -ENOMEM;
+	int actlen = 0, ret = -ENOMEM;
 
 	if (!d || wbuf == NULL || wlen == 0)
 		return -EINVAL;