Skip to content

Commit 7a4f31c

Browse files
committed
Merge tag 'input-for-v6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - a revert of endpoint checks in bcm5974 - the driver is being naughty and pokes at unclaimed USB interface, so the check fails. We need to fix the driver to claim both interfaces, and then re-implement the endpoints check - a fix to Synaptics RMI driver to avoid UAF on driver unload or device unbinding - a few new VID/PIDs added to xpad game controller driver - a change to gpio_keys_polled driver to quiet it when GPIO causes probe deferral. * tag 'input-for-v6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics-rmi4 - fix UAF of IRQ domain on driver removal Input: gpio_keys_polled - suppress deferred probe error for gpio Revert "Input: bcm5974 - check endpoint type before starting traffic" Input: xpad - add additional HyperX Controller Identifiers
2 parents 6dfeb04 + fbf8d71 commit 7a4f31c

File tree

4 files changed

+13
-29
lines changed

4 files changed

+13
-29
lines changed

drivers/input/joystick/xpad.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ static const struct xpad_device {
130130
{ 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 },
131131
{ 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 },
132132
{ 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 },
133+
{ 0x03f0, 0x038D, "HyperX Clutch", 0, XTYPE_XBOX360 }, /* wired */
134+
{ 0x03f0, 0x048D, "HyperX Clutch", 0, XTYPE_XBOX360 }, /* wireless */
133135
{ 0x03f0, 0x0495, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE },
136+
{ 0x03f0, 0x07A0, "HyperX Clutch Gladiate RGB", 0, XTYPE_XBOXONE },
137+
{ 0x03f0, 0x08B6, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE }, /* v2 */
138+
{ 0x03f0, 0x09B4, "HyperX Clutch Tanto", 0, XTYPE_XBOXONE },
134139
{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
135140
{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
136141
{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -463,6 +468,7 @@ static const struct usb_device_id xpad_table[] = {
463468
{ USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */
464469
XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */
465470
XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */
471+
XPAD_XBOX360_VENDOR(0x03f0), /* HP HyperX Xbox 360 controllers */
466472
XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */
467473
XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster Xbox 360 controllers */
468474
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft Xbox 360 controllers */

drivers/input/keyboard/gpio_keys_polled.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,10 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
315315

316316
error = devm_gpio_request_one(dev, button->gpio,
317317
flags, button->desc ? : DRV_NAME);
318-
if (error) {
319-
dev_err(dev,
320-
"unable to claim gpio %u, err=%d\n",
321-
button->gpio, error);
322-
return error;
323-
}
318+
if (error)
319+
return dev_err_probe(dev, error,
320+
"unable to claim gpio %u\n",
321+
button->gpio);
324322

325323
bdata->gpiod = gpio_to_desc(button->gpio);
326324
if (!bdata->gpiod) {

drivers/input/mouse/bcm5974.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch)
2020
*/
2121

22-
#include "linux/usb.h"
2322
#include <linux/kernel.h>
2423
#include <linux/errno.h>
2524
#include <linux/slab.h>
@@ -194,8 +193,6 @@ enum tp_type {
194193

195194
/* list of device capability bits */
196195
#define HAS_INTEGRATED_BUTTON 1
197-
/* maximum number of supported endpoints (currently trackpad and button) */
198-
#define MAX_ENDPOINTS 2
199196

200197
/* trackpad finger data block size */
201198
#define FSIZE_TYPE1 (14 * sizeof(__le16))
@@ -894,18 +891,6 @@ static int bcm5974_resume(struct usb_interface *iface)
894891
return error;
895892
}
896893

897-
static bool bcm5974_check_endpoints(struct usb_interface *iface,
898-
const struct bcm5974_config *cfg)
899-
{
900-
u8 ep_addr[MAX_ENDPOINTS + 1] = {0};
901-
902-
ep_addr[0] = cfg->tp_ep;
903-
if (cfg->tp_type == TYPE1)
904-
ep_addr[1] = cfg->bt_ep;
905-
906-
return usb_check_int_endpoints(iface, ep_addr);
907-
}
908-
909894
static int bcm5974_probe(struct usb_interface *iface,
910895
const struct usb_device_id *id)
911896
{
@@ -918,11 +903,6 @@ static int bcm5974_probe(struct usb_interface *iface,
918903
/* find the product index */
919904
cfg = bcm5974_get_config(udev);
920905

921-
if (!bcm5974_check_endpoints(iface, cfg)) {
922-
dev_err(&iface->dev, "Unexpected non-int endpoint\n");
923-
return -ENODEV;
924-
}
925-
926906
/* allocate memory for our device state and initialize it */
927907
dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL);
928908
input_dev = input_allocate_device();

drivers/input/rmi4/rmi_driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,12 +978,12 @@ static int rmi_driver_remove(struct device *dev)
978978

979979
rmi_disable_irq(rmi_dev, false);
980980

981-
irq_domain_remove(data->irqdomain);
982-
data->irqdomain = NULL;
983-
984981
rmi_f34_remove_sysfs(rmi_dev);
985982
rmi_free_function_list(rmi_dev);
986983

984+
irq_domain_remove(data->irqdomain);
985+
data->irqdomain = NULL;
986+
987987
return 0;
988988
}
989989

0 commit comments

Comments
 (0)