From patchwork Tue May 12 14:28:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uri Shkolnik X-Patchwork-Id: 23251 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4CETOYi024269 for ; Tue, 12 May 2009 14:29:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753004AbZELO2m (ORCPT ); Tue, 12 May 2009 10:28:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753169AbZELO2m (ORCPT ); Tue, 12 May 2009 10:28:42 -0400 Received: from web110801.mail.gq1.yahoo.com ([67.195.13.224]:38329 "HELO web110801.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753004AbZELO2l (ORCPT ); Tue, 12 May 2009 10:28:41 -0400 Received: (qmail 13227 invoked by uid 60001); 12 May 2009 14:28:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1242138522; bh=N0o7vfmkBMP8cm8EqjXZXYJGD9l4yUZeZblV2JoN2io=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=Z8SdiM4Bc5gwDHpUeBH99yuKeowmKGHpXBmMdjXTb2/PiokmAfENztrfM255fYL+vj6UCjrYfdQcUmR/wYFTvPDbVDIRf7SS/PUqkiluPUDuymLJqJFdPYX9AXhn5C7A/1KzaDS/nECYu4+yhiGTjgBWBp0mdNNFfJobFf7ZoPc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=gCem6veP0S5T2GnIyQ7SHg2izr4iUU1V1zdPtQK2KyEdUhnjjvgAZjuboU1RcAXzJHD+pXk2bXfjAT6QSak4nZwf+jo8cCrECnGqSXIsNX3EArL/9MhmUO/mYkMePelPOF6gQE5aZ9g7XD9OIlz4H1saHZpijECTvu1hlJCBLjc=; Message-ID: <77989.12979.qm@web110801.mail.gq1.yahoo.com> X-YMail-OSG: AtxWp2oVM1nLik5s_6NmRaKNV1HtQSaNQhSivC8Y17ZfEwDJmiD6yQAYRJHhgM680qCay1cp7UtYe.eSeMILJEiPq4B9ESuGVYbbQajKcMpGOrlLB5pfDC07i9LGdAyYpulsZoHMr300I2TFTWMMLrzN13GrkiTK8_DIA0m2VC6EppLasHoCeb69MWg8GdX86ZZEiya1Ty7j8QN9ZWigaTwUcOlXnEHume70Fo7TFz2FUZ7om8MwYDyns2HVlRc2WrWUEFYlIHjziGwEIZ.LGoErw1wSzBL3wYr8YoeQlKDycF7ePKe27waNIyis6P6eNVqiN2lgBrmNC0hHqUJTFp.CasyN5LkvUMttfPfvlPTPWk_w24rgWR53VQ-- Received: from [199.203.99.233] by web110801.mail.gq1.yahoo.com via HTTP; Tue, 12 May 2009 07:28:41 PDT X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10 Date: Tue, 12 May 2009 07:28:41 -0700 (PDT) From: Uri Shkolnik Subject: [PATCH] [0905_05] Siano: smsusb - lost buffers bug fix To: LinuxML MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org # HG changeset patch # User Uri Shkolnik # Date 1242138741 -10800 # Node ID ae0f17b305e7762643a9bc7f43c302c11f7b55b5 # Parent db8bfae234d4730f18823ca0686762a13e7997c9 [0905_05] Siano: smsusb - lost buffers bug fix From: Uri Shkolnik This patch fixes a problem were protocol buffers have been lost during USB disconnect events. Priority: normal Signed-off-by: Uri Shkolnik --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r db8bfae234d4 -r ae0f17b305e7 linux/drivers/media/dvb/siano/smsusb.c --- a/linux/drivers/media/dvb/siano/smsusb.c Tue May 12 17:19:30 2009 +0300 +++ b/linux/drivers/media/dvb/siano/smsusb.c Tue May 12 17:32:21 2009 +0300 @@ -65,14 +65,14 @@ static void smsusb_onresponse(struct urb struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context; struct smsusb_device_t *dev = surb->dev; - if (urb->status < 0) { - sms_err("error, urb status %d, %d bytes", + if (urb->status == -ESHUTDOWN) { + sms_err("error, urb status %d (-ESHUTDOWN), %d bytes", urb->status, urb->actual_length); return; } - if (urb->actual_length > 0) { - struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) surb->cb->p; + if ((urb->actual_length > 0) && (urb->status == 0)) { + struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)surb->cb->p; smsendian_handle_message_header(phdr); if (urb->actual_length >= phdr->msgLength) { @@ -111,7 +111,10 @@ static void smsusb_onresponse(struct urb "msglen %d actual %d", phdr->msgLength, urb->actual_length); } - } + } else + sms_err("error, urb status %d, %d bytes", + urb->status, urb->actual_length); + exit_and_resubmit: smsusb_submit_urb(dev, surb);