From: Oliver Neukum Date: Thu, 10 Feb 2011 14:33:10 +0000 (+0100) Subject: usb_wwan: fix error in marking device busy X-Git-Tag: MMI-PSA29.97-13-9~20524^2~137 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9c4558f7874676e31ea7a74caafcf09ebbc03ed;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git usb_wwan: fix error in marking device busy This fixes two errors: - the device is busy if a message was recieved even if resubmission fails - the device is not busy if resubmission fails due to -EPERM Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index b004b2a485c3..7bd06854f872 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -305,11 +305,16 @@ static void usb_wwan_indat_callback(struct urb *urb) /* Resubmit urb so we continue receiving */ if (status != -ESHUTDOWN) { err = usb_submit_urb(urb, GFP_ATOMIC); - if (err && err != -EPERM) - printk(KERN_ERR "%s: resubmit read urb failed. " - "(%d)", __func__, err); - else + if (err) { + if (err != -EPERM) { + printk(KERN_ERR "%s: resubmit read urb failed. " + "(%d)", __func__, err); + /* busy also in error unless we are killed */ + usb_mark_last_busy(port->serial->dev); + } + } else { usb_mark_last_busy(port->serial->dev); + } } }