Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3763341pxv; Mon, 19 Jul 2021 08:11:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4/EYoN+mdPjvz9DdpeW6W3sPQpKG+rendsvhLdYQpAitSUZfLHzCkzCaxbVHehHYnI5AF X-Received: by 2002:a05:6402:22a3:: with SMTP id cx3mr35615803edb.264.1626707516723; Mon, 19 Jul 2021 08:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626707516; cv=none; d=google.com; s=arc-20160816; b=GGl2853B3wh7zfmtcqjdk1HVPOFiNeT0gtBQcD9aNcNAvGzFZZmP3VtUE9M878MGIi LAxwtHY/IubaLBcD4JyzfGqACLuwSNyEwlPQjd7IZDpKaL8l6tHuOduGsg9zwjZOaIjf 9kDUTZRo94acLulMmKM+9uhKQH8H5T8EYsManAC6McWpnJkW/No9Op/QGyH8/DEa8EEj zNgIEa30YWJ3YWbzbCkLD6ZS6HKBFAwZg+bPF40dr49/7KdGsLn9moQYC5KY639Or2eH JSmP3AfoyCmWQCrHC46jooGP6utVJRdG4Z1PZkpmpF5++chVGAeOeqsA+xq23dIZ+SFL IkXQ== 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=CWusqKDpc9ie6bpbsDw00zpW2d1UEdGDyxgZMLQZ7V8=; b=dnSVSFt6g+xEhmrHjxc9j3G3wJ9g0QgdTEwiXptuh1J178WtPSf/pH6JulMf6osv9y n2EVJs4mBbXVnIwIqzKM0Dtr/i7cnqGuFoRJNJ0KqOcA2+Jy6Oky+xm1UI8wyvz2Yy75 +d5KcxtWL8EHmgNAResKQlU00Y1O3wCd38mA6b7uBIYBBbB8SIs2EtNuofz2FA79Fyno n8cdUuVlZE8hkbomYgBi6Mp9f0Pgb6IqHLZGlITgT048iohaqeoKZ6EXCKbRjIcMzreB 2+SeE5rk9bUdMl+IRDsoAlVosKcpNyew3WiETX2FMOOQ5h2oj6HefGwOTHfI/aqhpmg8 envA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T2g8ML71; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si21408908edv.295.2021.07.19.08.11.33; Mon, 19 Jul 2021 08:11:56 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=T2g8ML71; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243399AbhGSO1H (ORCPT + 99 others); Mon, 19 Jul 2021 10:27:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:36804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244033AbhGSOYn (ORCPT ); Mon, 19 Jul 2021 10:24:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6EE861166; Mon, 19 Jul 2021 15:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707094; bh=pcTpmDa2B6Mt9+IbFS58Ge7g5y18OtLbWxe0ijQFQoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T2g8ML71WtmVZOM9p9H7PqaxZVxRfkgL1BXwcpiVndoiRf2nUsOVPZVMeHf4tpsJp J3LIwlgyuuapzIOQa+pBi/9WdHk/H117aypfKsO2mB6bSVtDGbHfL2tx+LaZzGtQTa ZR7lq2shjplkumqBedAQhdifirirYTLDjJh0CeCM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Dmitry Torokhov Subject: [PATCH 4.9 003/245] Input: usbtouchscreen - fix control-request directions Date: Mon, 19 Jul 2021 16:49:05 +0200 Message-Id: <20210719144940.466833740@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.288257948@linuxfoundation.org> References: <20210719144940.288257948@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 41e81022a04a0294c55cfa7e366bc14b9634c66e upstream. The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation. Fix the four control requests which erroneously used usb_rcvctrlpipe(). Fixes: 1d3e20236d7a ("[PATCH] USB: usbtouchscreen: unified USB touchscreen driver") Fixes: 24ced062a296 ("usbtouchscreen: add support for DMC TSC-10/25 devices") Fixes: 9e3b25837a20 ("Input: usbtouchscreen - add support for e2i touchscreen controller") Signed-off-by: Johan Hovold Cc: stable@vger.kernel.org # 2.6.17 Link: https://lore.kernel.org/r/20210524092048.4443-1-johan@kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/usbtouchscreen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -266,7 +266,7 @@ static int e2i_init(struct usbtouch_usb int ret; struct usb_device *udev = interface_to_usbdev(usbtouch->interface); - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), + ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x01, 0x02, 0x0000, 0x0081, NULL, 0, USB_CTRL_SET_TIMEOUT); @@ -462,7 +462,7 @@ static int mtouch_init(struct usbtouch_u int ret, i; struct usb_device *udev = interface_to_usbdev(usbtouch->interface); - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), + ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), MTOUCHUSB_RESET, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); @@ -474,7 +474,7 @@ static int mtouch_init(struct usbtouch_u msleep(150); for (i = 0; i < 3; i++) { - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), + ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), MTOUCHUSB_ASYNC_REPORT, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); @@ -645,7 +645,7 @@ static int dmc_tsc10_init(struct usbtouc } /* start sending data */ - ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0), + ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), TSC10_CMD_DATA1, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);