Erm, to repeat my posting dated July 1, this is a bug ** IN COVERITY ** and so this patch SHOULD NOT BE APPLIED:
> > Date: Fri, 01 Jul 2005 12:41:36 -0700 > > From: [EMAIL PROTECTED] > > To: [email protected], [EMAIL PROTECTED] > > Subject: Re: [linux-usb-devel] coverity-usb-host-ehci-dbg-null-check.patch > > > > > Later in this function we check for the nullness of p.qh. So either this > > > additonal test is needed or the existing one is redundant. > > > > Later in this function, "p" may have a different value. > > In fact it may have been explicitly set to p.ptr = NULL. > > Looks to me like a bug in Coverity's checker. > > > > At the point this patch changes, we know that "p.ptr" is non-null, > > so since "p" is a union of pointer types, we know "p.qh" is also > > non-null at this point. Same patch. Same answer. :( Andrew, please pull this patch out. Zaur, please fix the ** BUG IN COVERITY ** ... the basic issue seems to be some miscomprehension about how unions work. Maybe the fix would be as simple as teaching it that all the pointers in that union are aliases for each other. - Dave > From [EMAIL PROTECTED] Mon Sep 5 14:56:31 2005 > To: [email protected] > Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] > From: [EMAIL PROTECTED] > Subject: [linux-usb-devel] [patch 1/1] coverity: usb/host/ehci-dbg null check > Date: Mon, 05 Sep 2005 14:46:19 -0700 > > > From: "KAMBAROV, ZAUR" <[EMAIL PROTECTED]> > > Later in this function we check for the nullness of p.qh. So either this > additonal test is needed or the existing one is redundant. > > This defect was found automatically by Coverity Prevent, a static analysis > tool. > > (akpm: there's another deref of p.qh later on. I think the test of p.qh is > simply bogus) > > Signed-off-by: Zaur Kambarov <[EMAIL PROTECTED]> > Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> > --- > > drivers/usb/host/ehci-dbg.c | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > > diff -puN drivers/usb/host/ehci-dbg.c~coverity-usb-host-ehci-dbg-null-check > drivers/usb/host/ehci-dbg.c > --- 25/drivers/usb/host/ehci-dbg.c~coverity-usb-host-ehci-dbg-null-check > Fri Jul 29 15:04:01 2005 > +++ 25-akpm/drivers/usb/host/ehci-dbg.c Fri Jul 29 15:05:25 2005 > @@ -523,14 +523,17 @@ show_periodic (struct class_device *clas > do { > switch (tag) { > case Q_TYPE_QH: > - temp = scnprintf (next, size, " qh%d-%04x/%p", > + if (p.qh) { > + temp = scnprintf(next, size, > + " qh%d-%04x/%p", > p.qh->period, > - le32_to_cpup (&p.qh->hw_info2) > + le32_to_cpup(&p.qh->hw_info2) > /* uframe masks */ > & (QH_CMASK | QH_SMASK), > - p.qh); > - size -= temp; > - next += temp; > + p.qh); > + size -= temp; > + next += temp; > + } > /* don't repeat what follows this qh */ > for (temp = 0; temp < seen_count; temp++) { > if (seen [temp].ptr != p.ptr) > _ > > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
