summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorNil Yi <teroincn@163.com>2021-08-14 11:40:09 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-10-08 13:54:16 +0200
commitcefdc9510a16f59de6ff82ed90c841545ec0aa13 (patch)
tree2e6e0be29f6ea22a2ea9ccc25ac2260eb2baee59 /drivers/media
parentmedia: dvb-frontends: mn88443x: Handle errors of clk_prepare_enable() (diff)
downloadlinux-cefdc9510a16f59de6ff82ed90c841545ec0aa13.tar.xz
linux-cefdc9510a16f59de6ff82ed90c841545ec0aa13.zip
media: rtl2832_sdr: clean the freed pointer and counter
After freed the dev->urb_list, we should set it to NULL as well as set counter to zero. Requested-by: Sean Young <sean@mess.org> Signed-off-by: Nil Yi <teroincn@163.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/rtl2832_sdr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c
index 1a2f0d2adadf..6a4f2997d6f5 100644
--- a/drivers/media/dvb-frontends/rtl2832_sdr.c
+++ b/drivers/media/dvb-frontends/rtl2832_sdr.c
@@ -376,8 +376,11 @@ static int rtl2832_sdr_alloc_urbs(struct rtl2832_sdr_dev *dev)
dev_dbg(&pdev->dev, "alloc urb=%d\n", i);
dev->urb_list[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->urb_list[i]) {
- for (j = 0; j < i; j++)
+ for (j = 0; j < i; j++) {
usb_free_urb(dev->urb_list[j]);
+ dev->urb_list[j] = NULL;
+ }
+ dev->urbs_initialized = 0;
return -ENOMEM;
}
usb_fill_bulk_urb(dev->urb_list[i],