LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Chen <Peter.Chen@freescale.com>
To: "balbi@ti.com" <balbi@ti.com>
Cc: 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 02:02:44 +0000 [thread overview]
Message-ID: <BN3PR0301MB0849AD8FBBB71F287C72B9D581180@BN3PR0301MB0849.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20150309154156.GB3739@saruman.tx.rr.com>
> > --- 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.
Peter
next prev parent reply other threads:[~2015-03-10 2:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 12:58 Tapasweni Pathak
2015-03-04 1:11 ` Peter Chen
2015-03-09 15:41 ` Felipe Balbi
2015-03-10 2:02 ` Peter Chen [this message]
2015-03-10 2:36 ` Felipe Balbi
2015-03-10 3:00 ` Peter Chen
2015-03-10 20:50 ` Felipe Balbi
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=BN3PR0301MB0849AD8FBBB71F287C72B9D581180@BN3PR0301MB0849.namprd03.prod.outlook.com \
--to=peter.chen@freescale.com \
--cc=balbi@ti.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 \
--subject='RE: [PATCH] drivers: usb: gadget: udc: Fix NULL dereference' \
/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
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).