From: Felipe Balbi <balbi@ti.com>
To: Peter Chen <Peter.Chen@freescale.com>
Cc: "balbi@ti.com" <balbi@ti.com>,
Tapasweni Pathak <tapaswenipathak@gmail.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"jg1.han@samsung.com" <jg1.han@samsung.com>,
"benoit.taine@lip6.fr" <benoit.taine@lip6.fr>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"julia.lawall@lip6.fr" <julia.lawall@lip6.fr>
Subject: Re: [PATCH] drivers: usb: gadget: udc: Fix NULL dereference
Date: Tue, 10 Mar 2015 15:50:45 -0500 [thread overview]
Message-ID: <20150310205045.GC18456@saruman.tx.rr.com> (raw)
In-Reply-To: <BN3PR0301MB08499996DF1FB985DE506F9A81180@BN3PR0301MB0849.namprd03.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
On Tue, Mar 10, 2015 at 03:00:49AM +0000, Peter Chen wrote:
>
> > On Tue, Mar 10, 2015 at 02:02:44AM +0000, Peter Chen wrote:
> > >
> > > > > --- a/drivers/usb/gadget/udc/lpc32xx_udc.c
> > > > > +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
> > > > > @@ -1803,7 +1803,7 @@ static int lpc32xx_ep_queue(struct usb_ep *_ep,
> > > > > req = container_of(_req, struct lpc32xx_request, req);
> > > > > ep = container_of(_ep, struct lpc32xx_ep, ep);
> > > > >
> > > > > - if (!_req || !_req->complete || !_req->buf ||
> > > > > + if (!_ep || !_req || !_req->complete || !_req->buf ||
> > > > > !list_empty(&req->queue))
> > > > > return -EINVAL;
> > > > >
> > > > > @@ -1815,8 +1815,7 @@ static int lpc32xx_ep_queue(struct usb_ep *_ep,
> > > > > }
> > > > >
> > > > >
> > > > > - if ((!udc) || (!udc->driver) ||
> > > > > - (udc->gadget.speed == USB_SPEED_UNKNOWN)) {
> > > > > + if ((!udc->driver) || (udc->gadget.speed == USB_SPEED_UNKNOWN))
> > > > {
> > > > > dev_dbg(udc->dev, "invalid device\n");
> > > > > return -EINVAL;
> > > > > }
> > > >
> > > > what's going to happen here ?
> > > >
> > >
> > > I just changed the current code, in fact, udc->driver is impossible to
> > > NULL which is cleared at .udc_stop.
> > >
> > > The speed is possible for unknown if the reset has occurred at that time.
> >
> > oh, alright.
>
> Do you need me or Tapasweni send patch for this?
if there's anything to be fixed, sure.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-03-10 20:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 12:58 [PATCH] drivers: usb: gadget: udc: Fix NULL dereference Tapasweni Pathak
2015-03-04 1:11 ` Peter Chen
2015-03-09 15:41 ` Felipe Balbi
2015-03-10 2:02 ` Peter Chen
2015-03-10 2:36 ` Felipe Balbi
2015-03-10 3:00 ` Peter Chen
2015-03-10 20:50 ` Felipe Balbi [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=20150310205045.GC18456@saruman.tx.rr.com \
--to=balbi@ti.com \
--cc=Peter.Chen@freescale.com \
--cc=benoit.taine@lip6.fr \
--cc=gregkh@linuxfoundation.org \
--cc=jg1.han@samsung.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=tapaswenipathak@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.