Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965421AbaDJDwg (ORCPT ); Wed, 9 Apr 2014 23:52:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41225 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934991AbaDJDWo (ORCPT ); Wed, 9 Apr 2014 23:22:44 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Pugliese , Ben Hutchings , Yang Yingliang Subject: [PATCH 3.4 090/134] usb: wusbcore: change WA_SEGS_MAX to a legal value Date: Wed, 9 Apr 2014 20:23:26 -0700 Message-Id: <20140410032311.307664585@linuxfoundation.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <20140410032259.587501440@linuxfoundation.org> References: <20140410032259.587501440@linuxfoundation.org> User-Agent: quilt/0.60-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Pugliese commit f74b75e7f920c700636cccca669c7d16d12e9202 upstream. change WA_SEGS_MAX to a number that is legal according to the WUSB spec. Signed-off-by: Thomas Pugliese [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings Cc: Yang Yingliang Signed-off-by: Greg Kroah-Hartman --- drivers/usb/wusbcore/wa-xfer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c @@ -90,7 +90,8 @@ #include "wusbhc.h" enum { - WA_SEGS_MAX = 255, + /* [WUSB] section 8.3.3 allocates 7 bits for the segment index. */ + WA_SEGS_MAX = 128, }; enum wa_seg_status { @@ -444,7 +445,7 @@ static ssize_t __wa_xfer_setup_sizes(str xfer->seg_size = (xfer->seg_size / maxpktsize) * maxpktsize; xfer->segs = (urb->transfer_buffer_length + xfer->seg_size - 1) / xfer->seg_size; - if (xfer->segs >= WA_SEGS_MAX) { + if (xfer->segs > WA_SEGS_MAX) { dev_err(dev, "BUG? ops, number of segments %d bigger than %d\n", (int)(urb->transfer_buffer_length / xfer->seg_size), WA_SEGS_MAX); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/