usb: cdc-wdm: Fix race between disconnect and debug messages
authorOliver Neukum <oliver@neukum.org>
Sat, 27 Feb 2010 19:55:26 +0000 (20:55 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Mar 2010 14:24:15 +0000 (07:24 -0700)
dev_dbg() and dev_err() cannot be used to report failures
that may have been caused by a device's removal

Signed-off-by: Oliver Neukum <neukum@b1-systems.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-wdm.c

index 940b17af162c791d78fa75b5fdc9b65eb58062c3..72e2eb0304597fb83df0813b15ca6d8cd7c78580 100644 (file)
@@ -435,11 +435,8 @@ retry:
                spin_lock_irq(&desc->iuspin);
 
                if (desc->rerr) { /* read completed, error happened */
-                       int t = desc->rerr;
                        desc->rerr = 0;
                        spin_unlock_irq(&desc->iuspin);
-                       dev_err(&desc->intf->dev,
-                               "reading had resulted in %d\n", t);
                        rv = -EIO;
                        goto err;
                }
@@ -477,8 +474,6 @@ retry:
 
 err:
        mutex_unlock(&desc->lock);
-       if (rv < 0 && rv != -EAGAIN)
-               dev_err(&desc->intf->dev, "wdm_read: exit error\n");
        return rv;
 }