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

Reply via email to