USB: failure in usblp's error path
authorOliver Neukum <oliver@neukum.name>
Wed, 29 Nov 2006 11:45:29 +0000 (12:45 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 29 Nov 2006 11:45:29 +0000 (12:45 +0100)
if urb submission fails due to a transient error here eg. ENOMEM,
the driver is dead. This fixes it.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/usb/class/usblp.c

index d34848ac30b0a9571db2dd6cd596cdf139b5c8df..cc03f6875ed084f93d0a112550b7301e7a205e2b 100644 (file)
@@ -700,6 +700,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