Skip to contentSkip to conversation

media: lmedm04: Add missing usb_free_urb to free, interrupt urb

PATCH Superseded Malcolm Priestley 2 participants 2 messages Nov 30, 2018 – Dec 4, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Malcolm Priestley

author maintainer
#0 lore raw

PATCH 1/4 media: lmedm04: Add missing usb_free_urb to free, interrupt urb

The interrupt urb is killed but never freed add the function

---
 drivers/media/usb/dvb-usb-v2/lmedm04.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/usb/dvb-usb-v2/lmedm04.c +1 -0
index f109c04f05ae..8b405e131439 100644
@@ -1264,6 +1264,7 @@ static void *lme2510_exit_int(struct dvb_usb_device *d)
 
 	if (st->lme_urb != NULL) {
 		usb_kill_urb(st->lme_urb);
+		usb_free_urb(st->lme_urb);
 		usb_free_coherent(d->udev, 128, st->buffer,
 				  st->lme_urb->transfer_dma);
 		info("Interrupt Service Stopped");
Signature · 1 line
2.19.1
#1 lore raw
Quoted 13 lines · Malcolm Priestley

The interrupt urb is killed but never freed add the function

---
 drivers/media/usb/dvb-usb-v2/lmedm04.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/usb/dvb-usb-v2/lmedm04.c +0 -0
index f109c04f05ae..8b405e131439 100644

drivers/media/usb/dvb-usb-v2/lmedm04.c static void *lme2510_exit_int(struct dvb_usb_device *d) · line 1267

Quoted 4 lines
drivers/media/usb/dvb-usb-v2/lmedm04.c +1 -0
@@ -1264,6 +1264,7 @@ static void *lme2510_exit_int(struct dvb_usb_device *d)
 
 	if (st->lme_urb != NULL) {
 		usb_kill_urb(st->lme_urb);
+		usb_free_urb(st->lme_urb);

Now st->lme_urb is a stale pointer.

drivers/media/usb/dvb-usb-v2/lmedm04.c static void *lme2510_exit_int(struct dvb_usb_device *d) · line 1269

Quoted 2 lines
drivers/media/usb/dvb-usb-v2/lmedm04.c +0 -0
 		usb_free_coherent(d->udev, 128, st->buffer,
 				  st->lme_urb->transfer_dma);

And now you're following it.

Quoted 3 lines
drivers/media/usb/dvb-usb-v2/lmedm04.c +0 -0
 		info("Interrupt Service Stopped");
Signature · 1 line
2.19.1