From: Felipe Balbi <balbi@kernel.org>
To: Lianwei Wang <lianwei.wang@gmail.com>
Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
lianwei.wang@gmail.com
Subject: Re: [PATCH] usb: gadget: avoid using gadget after freed
Date: Mon, 17 Jun 2019 15:40:04 +0300 [thread overview]
Message-ID: <87tvcogzbv.fsf@linux.intel.com> (raw)
In-Reply-To: <20190614070243.31565-1-lianwei.wang@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 864 bytes --]
Lianwei Wang <lianwei.wang@gmail.com> writes:
> The udc and gadget device will be deleted when udc device is
> disconnected and the related function will be unbind with it.
>
> But if the configfs is not deleted, then the function object
> will be kept and the bound status is kept true.
>
> Then after udc device is connected again and a new udc and
> gadget objects will be created and passed to bind interface.
> But because the bound is still true, the new gadget is not
> updated to netdev and a previous freed gadget will be used
> in netdev after bind.
>
> To fix this using after freed issue, always set the gadget
> object to netdev in bind interface.
>
> Signed-off-by: Lianwei Wang <lianwei.wang@gmail.com>
I can't actually understand what's the problem here. The gadget is not
deleted when we disconnect the cable.
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2019-06-17 12:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 7:02 [PATCH] usb: gadget: avoid using gadget after freed Lianwei Wang
2019-06-17 12:40 ` Felipe Balbi [this message]
2019-06-17 20:15 ` Lianwei Wang
2019-06-18 7:21 ` Felipe Balbi
2019-06-19 3:27 ` Lianwei Wang
2019-06-19 6:21 ` Felipe Balbi
2019-06-20 3:52 ` Lianwei Wang
2019-06-20 5:55 ` Felipe Balbi
2019-06-20 6:29 ` Lianwei Wang
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=87tvcogzbv.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=lianwei.wang@gmail.com \
--cc=linux-usb@vger.kernel.org \
/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).