Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6129698iog; Thu, 23 Jun 2022 11:59:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1yms1/Yt4SysmT8ScUxenjEpSYN1/tsnZzOv0ziQ3Y0JdZsyZjEY1G0GU4FgduEGZL5Xa X-Received: by 2002:a05:6402:294c:b0:435:2155:fbe8 with SMTP id ed12-20020a056402294c00b004352155fbe8mr12639126edb.256.1656010764206; Thu, 23 Jun 2022 11:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010764; cv=none; d=google.com; s=arc-20160816; b=hL4mzTlDDd0Rv9k3eJGKziFD/DWJCPCjTolH8PSDJsJ9oAGBfzqJSKOt/zps9x8WSJ 51CC/Ub4p952fTKqB1Xt4L03jBrsrnajl8IHvupiMoVkRpLlOnnUU3VkeTmZPOof1rA0 o+kGt31w5cXkwTYtjcmYr6g78zOX6px8jkmQIaDmkhM1dHsx7EwEKVjikeGlGyB8vLFX UYXGa3QpZwcXOEHrdv9iUzaH67Ei1/tAD/TBGdMFo7nnR54A2q0aA5fEoWtJcIbt98jk EIJ1lcWOUESVC37aKhHKEdG96KyUaP5HChuPn3Fgp2FNuvOGjH9qrWT6e3FgmGxUKu2w JQEg== 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=zqOghYkPPalw+rtAQf0fI4Ny1bhgbWWn2ymU+fxiiSE=; b=tiUYvnf8qPgXj3iFlEIpSTZNmA9+ThIZkS3xkcmwB7nF49a/BIZ7jgWuoHSRUtlEiq WNr4nuWGNJEo0CIvRltpznUnzO42yk/4B/TqAOAI7gxqPJFG8zgWCYRiXWBed9/W+4OZ 4EdJ/5gLUZ63z6Y/9cGDDqFxFEWsw03iX/miaD97HoBRd0GgPWudZqmzZGUjQCeYQHQi y+HzRhexuZN+MpfsLPm4eLlqPqSIQ5mDu/lxDdS14yQy9zZe88+g32kr6hFmzVO6Rh5P kUC5ZtnK+s8m1fB6So4Gcblhdsz26sicfdE28tWFMV3XfSbJBHImD5/tl/LTeIz7Reky ckoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uxoT2hAS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a50f107000000b004357523b6a3si420143edl.550.2022.06.23.11.58.59; Thu, 23 Jun 2022 11:59:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uxoT2hAS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236988AbiFWSTv (ORCPT + 99 others); Thu, 23 Jun 2022 14:19:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236839AbiFWSQr (ORCPT ); Thu, 23 Jun 2022 14:16:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1223C24097; Thu, 23 Jun 2022 10:23:19 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9EB8D61E9D; Thu, 23 Jun 2022 17:23:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FF35C3411B; Thu, 23 Jun 2022 17:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004997; bh=dah1VrpcId8Z+u4nGQ7YFJhY+zDgfrwXLh8LQLGIoDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxoT2hAS7tOW9TrUBfV/3re/weiEVoSttpxFTBYXsCelkkPOWXZJ6QzNsOmtvA/+H 3j60FtxQE73JevYCio9szzJ9WfR1hVvRCGAk0pLdmW3ecTuH6mRSTjywrJ2s30CS8N HVRNNLlOSUTSUmdCHTK89XcLmmmSYBI+l0jAB3p8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Ian Abbott Subject: [PATCH 4.19 211/234] comedi: vmk80xx: fix expression for tx buffer size Date: Thu, 23 Jun 2022 18:44:38 +0200 Message-Id: <20220623164349.021560809@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Ian Abbott commit 242439f7e279d86b3f73b5de724bc67b2f8aeb07 upstream. The expression for setting the size of the allocated bulk TX buffer (`devpriv->usb_tx_buf`) is calling `usb_endpoint_maxp(devpriv->ep_rx)`, which is using the wrong endpoint (should be `devpriv->ep_tx`). Fix it. Fixes: a23461c47482 ("comedi: vmk80xx: fix transfer-buffer overflow") Cc: Johan Hovold Cc: stable@vger.kernel.org # 4.9+ Reviewed-by: Johan Hovold Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20220607171819.4121-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/vmk80xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c @@ -685,7 +685,7 @@ static int vmk80xx_alloc_usb_buffers(str if (!devpriv->usb_rx_buf) return -ENOMEM; - size = max(usb_endpoint_maxp(devpriv->ep_rx), MIN_BUF_SIZE); + size = max(usb_endpoint_maxp(devpriv->ep_tx), MIN_BUF_SIZE); devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL); if (!devpriv->usb_tx_buf) return -ENOMEM;