Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: usb: tm6000:clear the freed pointer
@ 2021-08-14 10:58 Nil Yi
  2021-08-17 11:05 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Nil Yi @ 2021-08-14 10:58 UTC (permalink / raw)
  To: mchehab, linux-media

After free the ir->int_urb, the pointer need to
be set to NULL.

Signed-off-by: Nil Yi <teroincn@163.com>
---
 drivers/media/usb/tm6000/tm6000-input.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/tm6000/tm6000-input.c b/drivers/media/usb/tm6000/tm6000-input.c
index 84602edf3..49acb97ca 100644
--- a/drivers/media/usb/tm6000/tm6000-input.c
+++ b/drivers/media/usb/tm6000/tm6000-input.c
@@ -346,6 +346,7 @@ static int __tm6000_ir_int_start(struct rc_dev *rc)
 	ir->int_urb->transfer_buffer = kzalloc(size, GFP_ATOMIC);
 	if (!ir->int_urb->transfer_buffer) {
 		usb_free_urb(ir->int_urb);
+		ir->int_urb = NULL;
 		return err;
 	}
 	dprintk(1, "int interval: %d\n", dev->int_in.endp->desc.bInterval);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: usb: tm6000:clear the freed pointer
  2021-08-14 10:58 [PATCH] media: usb: tm6000:clear the freed pointer Nil Yi
@ 2021-08-17 11:05 ` Sean Young
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2021-08-17 11:05 UTC (permalink / raw)
  To: Nil Yi; +Cc: mchehab, linux-media

On Sat, Aug 14, 2021 at 06:58:22PM +0800, Nil Yi wrote:
> After free the ir->int_urb, the pointer need to
> be set to NULL.

Again, in the commit message please explain what code path will lead to 😱.

Thanks,

Sean

> 
> Signed-off-by: Nil Yi <teroincn@163.com>
> ---
>  drivers/media/usb/tm6000/tm6000-input.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/usb/tm6000/tm6000-input.c b/drivers/media/usb/tm6000/tm6000-input.c
> index 84602edf3..49acb97ca 100644
> --- a/drivers/media/usb/tm6000/tm6000-input.c
> +++ b/drivers/media/usb/tm6000/tm6000-input.c
> @@ -346,6 +346,7 @@ static int __tm6000_ir_int_start(struct rc_dev *rc)
>  	ir->int_urb->transfer_buffer = kzalloc(size, GFP_ATOMIC);
>  	if (!ir->int_urb->transfer_buffer) {
>  		usb_free_urb(ir->int_urb);
> +		ir->int_urb = NULL;
>  		return err;
>  	}
>  	dprintk(1, "int interval: %d\n", dev->int_in.endp->desc.bInterval);
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-17 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-14 10:58 [PATCH] media: usb: tm6000:clear the freed pointer Nil Yi
2021-08-17 11:05 ` Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox