|
Takashi Iwai |
1e4af7 |
From 59920635b89d74b9207ea803d5e91498d39e8b69 Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
1e4af7 |
From: Johan Hovold <johan@kernel.org>
|
|
Takashi Iwai |
1e4af7 |
Date: Tue, 10 Dec 2019 12:26:00 +0100
|
|
Takashi Iwai |
1e4af7 |
Subject: [PATCH] USB: idmouse: fix interface sanity checks
|
|
Takashi Iwai |
1e4af7 |
Git-commit: 59920635b89d74b9207ea803d5e91498d39e8b69
|
|
Takashi Iwai |
1e4af7 |
Patch-mainline: v5.5-rc2
|
|
Takashi Iwai |
1e4af7 |
References: bsc#1051510
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
Make sure to use the current alternate setting when verifying the
|
|
Takashi Iwai |
1e4af7 |
interface descriptors to avoid binding to an invalid interface.
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
Failing to do so could cause the driver to misbehave or trigger a WARN()
|
|
Takashi Iwai |
1e4af7 |
in usb_submit_urb() that kernels with panic_on_warn set would choke on.
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
|
|
Takashi Iwai |
1e4af7 |
Cc: stable <stable@vger.kernel.org>
|
|
Takashi Iwai |
1e4af7 |
Signed-off-by: Johan Hovold <johan@kernel.org>
|
|
Takashi Iwai |
1e4af7 |
Link: https://lore.kernel.org/r/20191210112601.3561-4-johan@kernel.org
|
|
Takashi Iwai |
1e4af7 |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Takashi Iwai |
1e4af7 |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
---
|
|
Takashi Iwai |
1e4af7 |
drivers/usb/misc/idmouse.c | 2 +-
|
|
Takashi Iwai |
1e4af7 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
|
|
Takashi Iwai |
1e4af7 |
index 4afb5ddfd361..e9437a176518 100644
|
|
Takashi Iwai |
1e4af7 |
--- a/drivers/usb/misc/idmouse.c
|
|
Takashi Iwai |
1e4af7 |
+++ b/drivers/usb/misc/idmouse.c
|
|
Takashi Iwai |
1e4af7 |
@@ -322,7 +322,7 @@ static int idmouse_probe(struct usb_interface *interface,
|
|
Takashi Iwai |
1e4af7 |
int result;
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
/* check if we have gotten the data or the hid interface */
|
|
Takashi Iwai |
1e4af7 |
- iface_desc = &interface->altsetting[0];
|
|
Takashi Iwai |
1e4af7 |
+ iface_desc = interface->cur_altsetting;
|
|
Takashi Iwai |
1e4af7 |
if (iface_desc->desc.bInterfaceClass != 0x0A)
|
|
Takashi Iwai |
1e4af7 |
return -ENODEV;
|
|
Takashi Iwai |
1e4af7 |
|
|
Takashi Iwai |
1e4af7 |
--
|
|
Takashi Iwai |
1e4af7 |
2.16.4
|
|
Takashi Iwai |
1e4af7 |
|