Commit a9be3931 authored by Nil Yi's avatar Nil Yi Committed by Mauro Carvalho Chehab

media: usb: airspy: clean the freed pointer and counter

After urb was freed, the pointer and counter need to be
cleaned.
Signed-off-by: default avatarNil Yi <teroincn@163.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 48d219f9
...@@ -415,8 +415,11 @@ static int airspy_alloc_urbs(struct airspy *s) ...@@ -415,8 +415,11 @@ static int airspy_alloc_urbs(struct airspy *s)
dev_dbg(s->dev, "alloc urb=%d\n", i); dev_dbg(s->dev, "alloc urb=%d\n", i);
s->urb_list[i] = usb_alloc_urb(0, GFP_ATOMIC); s->urb_list[i] = usb_alloc_urb(0, GFP_ATOMIC);
if (!s->urb_list[i]) { if (!s->urb_list[i]) {
for (j = 0; j < i; j++) for (j = 0; j < i; j++) {
usb_free_urb(s->urb_list[j]); usb_free_urb(s->urb_list[j]);
s->urb_list[j] = NULL;
}
s->urbs_initialized = 0;
return -ENOMEM; return -ENOMEM;
} }
usb_fill_bulk_urb(s->urb_list[i], usb_fill_bulk_urb(s->urb_list[i],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment