Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6158271ioo; Wed, 1 Jun 2022 23:35:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTyvv+LGPmDhRE3S02USzvIvq7w3zpFkqHwjWxxMphmm1wADY2fegGrVVpIcFjvqURJT7/ X-Received: by 2002:a05:6402:4244:b0:42b:27aa:d4c2 with SMTP id g4-20020a056402424400b0042b27aad4c2mr3655019edb.146.1654151727578; Wed, 01 Jun 2022 23:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654151727; cv=none; d=google.com; s=arc-20160816; b=i03Pog1zNIVLuLFAnnsa0SaLRTw4g+iErDGzTRYJ0+bJRXIzhQk1u1yDnmVjB1lli4 AXFHkMyGeaXfAqJ18N15UepXyNR81kG4DWeb5eMKAl9iOq+vVMR7cSAMGgjp3nlV1Bxc QXfxryUY2VyER+VmKsuqYJOJ6wrsC5ahG0s/wU+0up4p8exDvWBVPagYKOmZLIL4chZ+ 8AhOX0da0NgWlm9tL0kanqHP5OBEy7UNuTyHfdMlgttX2J0NK8q7jNTpNOrXlfOLqQRJ mCV7GNTf5liCRcHPS4k5yMXPDZudYF2U1qvIhYnN5paK4T4eG9QYfbbUE01AgLK/URXe mapQ== 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 :message-id:date:subject:cc:to:from; bh=2uwGdqtgXvNbDSv//FAtKJMaOV4fLiSsvzw4r4yylm8=; b=DrXa5nX6HB4jMb4teFgQZoufcJnaF6dUuB0ZYbReIAxZHeMOqTp3EHXhZ+gSAN+GM5 fe8woeyMD3ro/xHYPOMqqitSGMaTC3p6Grqw/1rr1QnPgIj0yLA70FQf1S3oMRNAeX+6 OI0LjSeKxZtadHbyZ2zF5Pmh38YORQC3cjO5kFc4CxKy7L86HiQRSXkLEEXBpifQFAXW kbsD87sgn4btakWloo/WFEhxzyLspEl+AV7JvKBwGycTURGXSAVRSwVMY3VB1W3bmGFP iRJcK/0fTk5u+syloL5sVve9oOihltz18xwR9lPP+aMLTUqvHr97y/ymFyiatFx6wKGu gGPQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u25-20020aa7d899000000b0042dd79cd7a6si3315402edq.557.2022.06.01.23.35.01; Wed, 01 Jun 2022 23:35:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbiFBFvN (ORCPT + 99 others); Thu, 2 Jun 2022 01:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbiFBFvN (ORCPT ); Thu, 2 Jun 2022 01:51:13 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4FF2AA019; Wed, 1 Jun 2022 22:51:10 -0700 (PDT) Received: from localhost.localdomain ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 2525oSaA027428-2525oSaD027428 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 2 Jun 2022 13:50:32 +0800 From: Dongliang Mu To: Mauro Carvalho Chehab , gushengxian , Hans Verkuil , Johan Hovold , Oliver Neukum , Sean Young Cc: Dongliang Mu , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: flexcop-usb: fix sanity check of bNumEndpoints Date: Thu, 2 Jun 2022 13:50:24 +0800 Message-Id: <20220602055027.849014-1-dzm91@hust.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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: Dongliang Mu Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type ") adds a sanity check for endpoint[1], but fails to modify the sanity check of bNumEndpoints. Fix this by modifying the sanity check of bNumEndpoints to 2. Fixes: d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type") Signed-off-by: Dongliang Mu --- drivers/media/usb/b2c2/flexcop-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 7835bb0f32fc..eb54bfdda01f 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -509,7 +509,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb) return ret; } - if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1) + if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 2) return -ENODEV; if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc)) return -ENODEV; -- 2.25.1