OSDN Git Service

[PATCH] fix for transient error in usb printer driver
authorOliver Neukum <oliver@neukum.org>
Wed, 29 Nov 2006 12:06:52 +0000 (13:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Dec 2006 08:25:40 +0000 (09:25 +0100)
Hi,

this is a port of a fix for 2.6 which handles transient errors while
writing to the printer. The buffer has to be marked free again if
urb submission fails, as the completion handler can't do it.
Please apply to the 2.4 tree.

Regards
Oliver

Signed-off-by: Oliver Neukum <oliver@neukum.name>
drivers/usb/printer.c

index 6d751cd..a0d18a2 100644 (file)
@@ -692,6 +692,7 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count,
                usblp->wcomplete = 0;
                err = usb_submit_urb(usblp->writeurb);
                if (err) {
+                       usblp->wcomplete = 1;
                        if (err != -ENOMEM)
                                count = -EIO;
                        else