From 4f6e5d61ddd5b68787736f1afef0ac7a5198676f Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Mon, 13 Aug 2007 22:50:13 -0700 Subject: [PATCH] --- yaml --- r: 67841 b: refs/heads/master c: fc401e697f8c00ad1178a6758e86e3881dfa3181 h: refs/heads/master i: 67839: 132368dd610ddc8b17cbdeb1bc3bab7e3faf9439 v: v3 --- [refs] | 2 +- trunk/drivers/usb/class/usblp.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 04c7f56bd90a..29381671c7ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7b5cd5fefbe023625a7ff7604e8beb9a15a9efab +refs/heads/master: fc401e697f8c00ad1178a6758e86e3881dfa3181 diff --git a/trunk/drivers/usb/class/usblp.c b/trunk/drivers/usb/class/usblp.c index 9696668e5752..2c4a359355ba 100644 --- a/trunk/drivers/usb/class/usblp.c +++ b/trunk/drivers/usb/class/usblp.c @@ -345,16 +345,17 @@ static int usblp_check_status(struct usblp *usblp, int err) unsigned char status, newerr = 0; int error; - error = usblp_read_status (usblp, usblp->statusbuf); - if (error < 0) { + mutex_lock(&usblp->mut); + if ((error = usblp_read_status(usblp, usblp->statusbuf)) < 0) { + mutex_unlock(&usblp->mut); if (printk_ratelimit()) printk(KERN_ERR "usblp%d: error %d reading printer status\n", usblp->minor, error); return 0; } - status = *usblp->statusbuf; + mutex_unlock(&usblp->mut); if (~status & LP_PERRORP) newerr = 3;