Re: [PATCH v1] usb: usbfs: fix double-free of usb memory upon submiturb error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 4 Aug 2019 gavinli@xxxxxxxxxxxxxx wrote:

> From: Gavin Li <git@xxxxxxxxxxxxxx>
> 
> Upon an error within proc_do_submiturb(), dec_usb_memory_use_count()
> gets called once by the error handling tail and again by free_async().
> Remove the first call.
> 
> Signed-off-by: Gavin Li <git@xxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/devio.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index fa783531ee88..f026a0d54ce5 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -1789,8 +1789,6 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
>  	return 0;
>  
>   error:
> -	if (as && as->usbm)
> -		dec_usb_memory_use_count(as->usbm, &as->usbm->urb_use_count);
>  	kfree(isopkt);
>  	kfree(dr);
>  	if (as)

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux