Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1822320pxb; Wed, 9 Feb 2022 05:21:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1V7Vzl3myXJjHTtRbLlHnAZHIDPGsouE6HiHwt+dU+vym/VUwcLqt5c+2OfarvPx8YsMK X-Received: by 2002:a17:902:e889:: with SMTP id w9mr47942plg.95.1644412865599; Wed, 09 Feb 2022 05:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644412865; cv=none; d=google.com; s=arc-20160816; b=WJrbShRGQIhK1UXQuaMivsQPbko/QMtvpHNgVOsUfEPdV9kBFXge7hKn9O8GdpDrVL t+P3Eb51wOkr2lMma0Lo0ZWLCpDLl+jIuOLT+/6GrmHF8/Rhc0YU0sWO6EQN/rEnZwJ1 xxdl0548yZcnTdjEULtqh4HvbUIqoIgTCbHsW93TJIeehUOHSY8FHVW4rrhePmKCTPvJ S9qV5wqW2n0Tf26DCEVMNnIw4EKQ248uAGgRvYZooR8bJz/oOCHgBKYf7eAKHytFlIxb 7Ni11ufeBtser97DkJuE28CpSaFPivihCmq3+A/BQkfV4MN8QmEn+HkdFkh6YKY67MOn VGzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DbQJ89CA/fQmh2BGTpLxO8Ow1Y2gQmTigGDltUGYO+w=; b=zcVxxMqTyaaYpWyVOPQTPZ6gJyF1F2fQIrNAkprz0C37QuZrK9k69QN+pQXj+AnEVr GHuEid5nyqYWnfcohJcHZi/gVkMczYMwZJO9FE1B9LpZ2v1GvZjVgqSOOebb3BzwAztU cEonZatPppD9is5vKupEpiqNN3ZEAkxo6zL6NOBPDmA38ZoMq0ATcQKtU1T9+po7aR+h gz6Wur8sp+TtF6HumIv8OgV4ChrcMZKiD3OO7bTZThON0NMTqxnk1VkGwIaL3qQsaxCL Mpc4QH2g1uB7rHd1hI+Sc0vhsYhUleLL5RSsLRnwefXtH5x5IO17wsB/nZNzo7ZGQNMK OfIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YRa+GUFd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k190si1458834pgd.202.2022.02.09.05.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 05:21:05 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YRa+GUFd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F002EE0481CB; Wed, 9 Feb 2022 02:08:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382531AbiBGLTg (ORCPT + 99 others); Mon, 7 Feb 2022 06:19:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359452AbiBGLOx (ORCPT ); Mon, 7 Feb 2022 06:14:53 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A65FBC0401F2; Mon, 7 Feb 2022 03:14:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 88766B811AF; Mon, 7 Feb 2022 11:14:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED44C004E1; Mon, 7 Feb 2022 11:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644232455; bh=ENdP0HiCeo/ou9suAY2/M17r/tqT17x+t6XVJsAoOcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YRa+GUFdEWR/SC90vncd2mIKx4O1x+oDhyds9lo6SQFRq/fuAe4jO6BLeE51T7K0x YiCK9sZLBnRKs8J+vbfXPrMwDGsYeNvs9Q9veKGLZD0sZyypQbZoUE3TKw7Fq8kIhe IRLT1kh1oKNATbqQg9YW2RJPZskzvxbGFNDKU9/c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavankumar Kondeti Subject: [PATCH 4.19 15/86] usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS Date: Mon, 7 Feb 2022 12:05:38 +0100 Message-Id: <20220207103758.058388761@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103757.550973048@linuxfoundation.org> References: <20220207103757.550973048@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavankumar Kondeti commit 904edf8aeb459697129be5fde847e2a502f41fd9 upstream. Currently when gadget enumerates in super speed plus, the isoc endpoint request buffer size is not calculated correctly. Fix this by checking the gadget speed against USB_SPEED_SUPER_PLUS and update the request buffer size. Fixes: 90c4d05780d4 ("usb: fix various gadgets null ptr deref on 10gbps cabling.") Cc: stable Signed-off-by: Pavankumar Kondeti Link: https://lore.kernel.org/r/1642820602-20619-1-git-send-email-quic_pkondeti@quicinc.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_sourcesink.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c @@ -583,6 +583,7 @@ static int source_sink_start_ep(struct f if (is_iso) { switch (speed) { + case USB_SPEED_SUPER_PLUS: case USB_SPEED_SUPER: size = ss->isoc_maxpacket * (ss->isoc_mult + 1) *