Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1229034
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] USB: EHCI: fix dereference of ERR_PTR |
| Date | 2015-09-21 07:00 +0200 |
| Message-ID | <qb1mO-4P7-5@gated-at.bofh.it> (permalink) |
| References | <q9lzk-6Gb-31@gated-at.bofh.it> <qaZkZ-1XG-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Sep 21, 2015 at 10:48:52AM +0800, Lu, Baolu wrote:
>
>
> On 09/16/2015 10:08 PM, Sudip Mukherjee wrote:
> >On error find_tt() returns either a NULL pointer or the error value in
> >ERR_PTR. But we were dereferencing it directly without even checking if
> >find_tt() returned a valid pointer or not.
> >
> >Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> >---
> > drivers/usb/host/ehci-sched.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> >diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
> >index f9a3327..27bced7 100644
> >--- a/drivers/usb/host/ehci-sched.c
> >+++ b/drivers/usb/host/ehci-sched.c
> >@@ -257,6 +257,8 @@ static void reserve_release_intr_bandwidth(struct ehci_hcd *ehci,
> > /* FS/LS bus bandwidth */
> > if (tt_usecs) {
> > tt = find_tt(qh->ps.udev);
> >+ if (!tt || IS_ERR(tt))
>
> Why not IS_ERR_OR_NULL()?
This was v1, corrected in v2. And Alan has already explained why this
patch is not required.
regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] USB: EHCI: fix dereference of ERR_PTR Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-16 16:10 +0200
Re: [PATCH] USB: EHCI: fix dereference of ERR_PTR Fabio Estevam <festevam@gmail.com> - 2015-09-16 16:20 +0200
Re: [PATCH] USB: EHCI: fix dereference of ERR_PTR Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-09-16 16:30 +0200
[PATCH v2] USB: EHCI: fix dereference of ERR_PTR Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-16 18:30 +0200
Re: [PATCH v2] USB: EHCI: fix dereference of ERR_PTR Alan Stern <stern@rowland.harvard.edu> - 2015-09-16 19:00 +0200
Re: [PATCH v2] USB: EHCI: fix dereference of ERR_PTR Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-18 07:50 +0200
Re: [PATCH v2] USB: EHCI: fix dereference of ERR_PTR Alan Stern <stern@rowland.harvard.edu> - 2015-09-18 16:50 +0200
Re: [PATCH] USB: EHCI: fix dereference of ERR_PTR "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-09-21 04:50 +0200
Re: [PATCH] USB: EHCI: fix dereference of ERR_PTR Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-21 07:00 +0200
csiph-web