USB: failure in usblp's error path
authorOliver Neukum <oliver@neukum.name>
Sat, 28 Oct 2006 09:36:59 +0000 (11:36 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Nov 2006 19:57:18 +0000 (11:57 -0800)
if urb submission fails due to a transient error here eg. ENOMEM
, the driver is dead. This fixes it.

Regards
Oliver

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/usblp.c

index 809d465..16353b6 100644 (file)
@@ -722,6 +722,7 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
                usblp->wcomplete = 0;
                err = usb_submit_urb(usblp->writeurb, GFP_KERNEL);
                if (err) {
+                       usblp->wcomplete = 1;
                        if (err != -ENOMEM)
                                count = -EIO;
                        else