Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6141004iog; Thu, 23 Jun 2022 12:11:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uiC/eGxby+trserIbfwyGB/AvhKNbsaURjvR7Z2YthBLapP8Tf40V3ZNGnoZs8JqVX6y3J X-Received: by 2002:a05:6402:51ce:b0:435:c7f8:2a87 with SMTP id r14-20020a05640251ce00b00435c7f82a87mr6813321edd.411.1656011511359; Thu, 23 Jun 2022 12:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011511; cv=none; d=google.com; s=arc-20160816; b=SKc2k0FvlNjroH4Ovq226Zga/9psDhgJw/dX5YQ3fSBBPPEpzOHlnErVtv1KDMnM0S XMivFQ62tyC3M+m8OLZ+iLQq9UTTb2OnSPXcCPD0EZReGh+waz2xqN5bzFmJtZ+GVQji Zfrl7rIgFeXoNI5dHjv6Fwr1D2ql4DyKnpRIiRnVLJNiryQBpbZikscd2IwdCh8WLEWN G0e/qk0vBSlgeVM71VRGnEZQseXoL7VJOwalE2nHysQ0NZjf7w3ppishZKe7G8D0qQh8 FO/aRw76sQR4Q+Zzol4Pskz0oL8amlx/dA3eRAL/9Dg/kiZwdnvLlM6A9ioBtG5Z/B+z SrIg== 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=DiwHXyhjL2tVr7f8GiOSmzCmHfIvh4eB4rnHUfUd3D0=; b=izlbxYAtmkGpic6JojGpQjc1c/oGQvVxVBe2xPNAUDw5ydiWUFgkkBe9qsjKJrMePE dfUx3FrsGBS+PSisjBuaoJfsX66DxOV21PVA1bcfj+NQJNGXTJnp0P+G64blHErMLdl9 u/P337bfc1S1j9jk1NIuo91NQbA7IulH2FZTtGluq+7F9ipKbKV+2371IZF3JS94MBH1 l2QeBl4x7efclBntY+6rvOmt+oakFMcaOdW43pYyMlqnydtUxWdWo3n7SOKl85EF02hb VYqRRnOLrEtMknSXR+M+VVv3IeRYxEMJZXUOrNEymMQwUY9+liKtwUM+Kem6XH8xTRMh zsXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="I642/gRR"; 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 rl24-20020a170907217800b00718c1dc910bsi3599928ejb.719.2022.06.23.12.11.26; Thu, 23 Jun 2022 12:11:51 -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="I642/gRR"; 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 S231616AbiFWRL2 (ORCPT + 99 others); Thu, 23 Jun 2022 13:11:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbiFWRJ1 (ORCPT ); Thu, 23 Jun 2022 13:09:27 -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 57ACA562CF; Thu, 23 Jun 2022 09:57:32 -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 94E2D60B2C; Thu, 23 Jun 2022 16:57:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76D3EC3411B; Thu, 23 Jun 2022 16:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003448; bh=6XAypWJoYaPQZyaDCVQ3fpYCncTok/BXGrjFVTqXzHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I642/gRR+LqW5oN9B1dFDrmMhOOktB6vDcW58cg+w/rNafYAV4eaKrlO272Llx2A+ VlWaLkqRl93bpJCDnHzedGGv4Z0op3CAvtIW0bbKMRvDbt1Cu/e8LTWmtI6Fo6rvau g+D9H6GwlnNt7GzwJstJtj9+CaAjGw/Z/xVu/XA4= 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.9 242/264] comedi: vmk80xx: fix expression for tx buffer size Date: Thu, 23 Jun 2022 18:43:55 +0200 Message-Id: <20220623164350.920498267@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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 @@ -694,7 +694,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;