From: Gavin Li Date: Sun, 4 Aug 2019 23:50:44 +0000 (-0700) Subject: usb: usbfs: fix double-free of usb memory upon submiturb error X-Git-Tag: v4.14.139~66 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=44db85e0a8e0c277921f7c4b7a4b6bfc757e8969;p=users%2Fdwmw2%2Flinux.git usb: usbfs: fix double-free of usb memory upon submiturb error commit c43f28dfdc4654e738aa6d3fd08a105b2bee758d upstream. 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 Acked-by: Alan Stern Cc: stable Link: https://lore.kernel.org/r/20190804235044.22327-1-gavinli@thegavinli.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 492977f78fdef..62b2a7105f023 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1811,8 +1811,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)