Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2521933imu; Thu, 29 Nov 2018 06:21:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WnFEwOPfVJZNawy6pyOpR8RM03FgYfU1Q7KtySNjSE5e/wdVEePggQBywuXWlxg9EXAADY X-Received: by 2002:a62:1c06:: with SMTP id c6mr1531591pfc.157.1543501304239; Thu, 29 Nov 2018 06:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501304; cv=none; d=google.com; s=arc-20160816; b=SdtZ/AWQOUDUGlsQ93TgApk8DL9D7GFCU+VMgdMiGH6ySjRMU/sgQDbwVGVdTGqixt gHWykW075Q+ZuPAMAvJLEQb3lmZKqr/b9U2uKn0cFWnZ/PM7XH1P1MqTk+ZN/Pp/VVmD 9GS43yLTZ5aIb4iAmdElWB8nJ1eIvyF5OXP9xRiUh9xG8IdssSHYy7OeU7mVYxemFzrn v1m50LLXNFdAPx24Iu70+BGCZTcpk7IdMhZUod+KmC3O8iR0RP5paukoZnBWhN4AUaf4 FSR9E1TW0x4cDY7Ciz99JdPT7cYIaIpVIyjUSZkUOhiTywr145iQCcoEau8WRnhF5NKS 6wSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bAOp8ieo/0t9ISq5sbs8+TEHhhj9W/VlnXORU1oULsE=; b=R7Joqp8Nj9T9dDCTonxnyYZqkObAjPdH4BXXlKTnpNykMam7dftSaeJRRorFYzXBw8 IgWk7Cnu81NorkdirnX2fseMHbCgJaoYAwQYhbdSPKMiU7378MMckfJnkdoNgaA7iYlB P4qMfP3MrZVNYENuxgFY7XEFsJieRKQMsjCiOc2I81fAJ04IS7XcP+mYUi72Vux65lpT LJuuTxeoFyw4ZrmZiXN+zCX+6pDt5N2BfnMCqklY9u4zeeK3adGSRLo3fM1pnX6EiNxE lJjM91HtQAvRWe8ppIZbkWLmV8Ewp1kZdSiV04oUD0z/qUWzyyy82WyQaRS5mkYjwOJd kYTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bTBocCHb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si2305040pfa.80.2018.11.29.06.21.28; Thu, 29 Nov 2018 06:21:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bTBocCHb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730965AbeK3BYh (ORCPT + 99 others); Thu, 29 Nov 2018 20:24:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:47506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbeK3BYg (ORCPT ); Thu, 29 Nov 2018 20:24:36 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E190205C9; Thu, 29 Nov 2018 14:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501145; bh=nS3WFZJYUQAw88EuwbnpSbuz53vvK3ka4xWbGIK3Fl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bTBocCHboxBUAsy8Dy0FEBvNC1ecaqp2Cojo05eSqPkG+jxpNKQU6CFLq33BrS4hY OPZ8P3Ig4yQeWpCb1bJqRcn3qK9uHxCtU5CaddFURMjihYrG3Zd9J1Fz+hj6M3iKk2 GnBumdw3Q9jzwxH+0BuXNj8u9O+4zIlB391riNvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Konovalov , Cameron Gutman , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.4 61/86] Input: xpad - validate USB endpoint type during probe Date: Thu, 29 Nov 2018 15:12:26 +0100 Message-Id: <20181129140115.135763514@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140109.832117862@linuxfoundation.org> References: <20181129140109.832117862@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 122d6a347329818419b032c5a1776e6b3866d9b9 ] We should only see devices with interrupt endpoints. Ignore any other endpoints that we find, so we don't send try to send them interrupt URBs and trigger a WARN down in the USB stack. Reported-by: Andrey Konovalov Tested-by: Andrey Konovalov Cc: # c01b5e7464f0 Input: xpad - don't depend on endpoint order Signed-off-by: Cameron Gutman Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/joystick/xpad.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index f8e34ef643c7..d86e59515b9c 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1764,10 +1764,12 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id struct usb_endpoint_descriptor *ep = &intf->cur_altsetting->endpoint[i].desc; - if (usb_endpoint_dir_in(ep)) - ep_irq_in = ep; - else - ep_irq_out = ep; + if (usb_endpoint_xfer_int(ep)) { + if (usb_endpoint_dir_in(ep)) + ep_irq_in = ep; + else + ep_irq_out = ep; + } } if (!ep_irq_in || !ep_irq_out) { -- 2.17.1