Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2099179pxb; Sat, 22 Jan 2022 16:14:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNpeuF4mngNoOx70vmjMuFj2iOwjQ8Fu853LR5tJzTudeZ28MAZHjBso+CMDfUBrf00Sq+ X-Received: by 2002:a17:903:2447:b0:14b:20ad:c1b1 with SMTP id l7-20020a170903244700b0014b20adc1b1mr7092020pls.82.1642896853688; Sat, 22 Jan 2022 16:14:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642896853; cv=none; d=google.com; s=arc-20160816; b=YGoYphijXBOQew5/7xQBCA4Q+iC9H36da8/eQyxGnaAGCABkmsABJaSrGlAQHLIbCE 9CcYLi+t7z598XAp/+yqS7RzNgtTYemudAIlXp3TqSXoyCNx0a6IncPYm75ktoT2AflQ zTLQcQpzRyorVI1Z/GwCwjQ8nylj4A4pA/bc3IqQUk8UsLCd3Yx5ONdr7noo1XnyI7AZ mpkLIAC4Kbtwc7bNIcMF4WqFdt3dW93hKtdj1H6xNaxRXAteB8xr/xTp06To7ZlpnXUu Wbh+mPkWlbfzGNACMIujAiEAIykE4T4vXio8EFCwmnfqlz9FicgYxkp2LdNremfBYmZF dYlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=lrRV9BdZ0PK0F7XbnSFRPik4O0MEobW7m7RCIpstsJ0=; b=eUH9xzdLF0b6CPAWuMvwz79nav/4df2KOyQ3Hf8qbpc/OY4/DOqNNchOS+9z/5F3EH PaJMINA4DkyW3T0/ocLkKOUFVf8c1RNBF/E/Afh9Yeyu6uwf0gr82waaXnWXBFHo7lbg TdaDtyUwI8zqiiOsTo4H1LMR39KvWfQHvcQZwBQBUurvCt2jyuaFt/dqy5W8Oo84Oki8 5Lgu5SHXsaqXGhliduis6hjDU2Ue6mbKPPUJn8GIjZ2G/cptM32C7Dv/j4hlkMD63aQQ I6enNTUiYcBy+v9Ycosua6RSSAIiC+SOoMfpKe29Z7UhztYu2L0uPYQW4QktD+0BW1YD KgHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=qV6JNKTs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si8188335pgr.752.2022.01.22.16.14.02; Sat, 22 Jan 2022 16:14:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=qV6JNKTs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbiAVDDd (ORCPT + 99 others); Fri, 21 Jan 2022 22:03:33 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:50021 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbiAVDDc (ORCPT ); Fri, 21 Jan 2022 22:03:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1642820612; x=1674356612; h=from:to:cc:subject:date:message-id:mime-version; bh=lrRV9BdZ0PK0F7XbnSFRPik4O0MEobW7m7RCIpstsJ0=; b=qV6JNKTslnX2HUMSlVhzGUpKPl12GWxcjqZrjIUVNrjfoyZTrJDYtMCi ouEBbvdYh/jp3H4I4DALay94L0naydpWC+tzdshapJUbaFrqJI/4+On3w Pcq85wUhQnpvsiqd2vWA12e/lR0jo3jYppcbT1/F9o9f4ABbRvWt55jry M=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 21 Jan 2022 19:03:32 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2022 19:03:32 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Fri, 21 Jan 2022 19:03:31 -0800 Received: from quicinc.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Fri, 21 Jan 2022 19:03:29 -0800 From: Pavankumar Kondeti To: Felipe Balbi , Greg Kroah-Hartman , Alan Stern CC: , , "Pavankumar Kondeti" Subject: [PATCH V2] usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS Date: Sat, 22 Jan 2022 08:33:22 +0530 Message-ID: <1642820602-20619-1-git-send-email-quic_pkondeti@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.") Signed-off-by: Pavankumar Kondeti --- v2: - Added Fixes tag - Removed fallthrough as we are using single block in switch drivers/usb/gadget/function/f_sourcesink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c index 1abf08e..6803cd6 100644 --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c @@ -584,6 +584,7 @@ static int source_sink_start_ep(struct f_sourcesink *ss, bool is_in, if (is_iso) { switch (speed) { + case USB_SPEED_SUPER_PLUS: case USB_SPEED_SUPER: size = ss->isoc_maxpacket * (ss->isoc_mult + 1) * -- 2.7.4