diff options
author | Gavin Li <git@thegavinli.com> | 2019-08-04 19:50:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-05 11:27:52 -0400 |
commit | c43f28dfdc4654e738aa6d3fd08a105b2bee758d (patch) | |
tree | 5c875723c4a6058d66bacab1d7ccf3059f391744 | |
parent | fc05481b2fcabaaeccf63e32ac1baab54e5b6963 (diff) |
usb: usbfs: fix double-free of usb memory upon submiturb error
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@thegavinli.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190804235044.22327-1-gavinli@thegavinli.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/core/devio.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index b265ab5405f9..9063ede411ae 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1812,8 +1812,6 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb | |||
1812 | return 0; | 1812 | return 0; |
1813 | 1813 | ||
1814 | error: | 1814 | error: |
1815 | if (as && as->usbm) | ||
1816 | dec_usb_memory_use_count(as->usbm, &as->usbm->urb_use_count); | ||
1817 | kfree(isopkt); | 1815 | kfree(isopkt); |
1818 | kfree(dr); | 1816 | kfree(dr); |
1819 | if (as) | 1817 | if (as) |