This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: rtl2832_sdr: clean the freed pointer and counter
Author:  Nil Yi <[email protected]>
Date:    Sat Aug 14 11:40:09 2021 +0200

After freed the dev->urb_list, we should set it to NULL as well as set
counter to zero.

Requested-by: Sean Young <[email protected]>
Signed-off-by: Nil Yi <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb-frontends/rtl2832_sdr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

---

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],

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to