From: Alan Stern <stern@rowland.harvard.edu>
To: gavinli@thegavinli.com
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-usb@vger.kernel.org>,
"Steinar H . Gunderson" <sesse@google.com>,
Gavin Li <git@thegavinli.com>
Subject: Re: [PATCH v1] usb: usbfs: fix double-free of usb memory upon submiturb error
Date: Mon, 5 Aug 2019 10:09:00 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44L0.1908051008310.1626-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20190804235044.22327-1-gavinli@thegavinli.com>
On Sun, 4 Aug 2019 gavinli@thegavinli.com wrote:
> From: Gavin Li <git@thegavinli.com>
>
> 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>
> ---
> 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@rowland.harvard.edu>
prev parent reply other threads:[~2019-08-05 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-04 23:50 [PATCH v1] usb: usbfs: fix double-free of usb memory upon submiturb error gavinli
2019-08-05 14:09 ` Alan Stern [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44L0.1908051008310.1626-100000@iolanthe.rowland.org \
--to=stern@rowland.harvard.edu \
--cc=gavinli@thegavinli.com \
--cc=git@thegavinli.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=sesse@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).