Skip to contentSkip to conversation

ati_remote: sanity check for both endpoints

PATCH New Oliver Neukum 1 participant 1 message Sep 16, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ati_remote: sanity check for both endpoints

If you do sanity checks, you should do them for both endpoints. Hence introduce checking for endpoint type for the output endpoint, too.

---
 drivers/media/rc/ati_remote.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/media/rc/ati_remote.c +4 -0
index 9cdef17b4793..c12dda73cdd5 100644
@@ -835,6 +835,10 @@ static int ati_remote_probe(struct usb_interface *interface,
 		err("%s: endpoint_in message size==0? \n", __func__);
 		return -ENODEV;
 	}
+	if (!usb_endpoint_is_int_out(endpoint_out)) {
+		err("%s: Unexpected endpoint_out\n", __func__);
+		return -ENODEV;
+	}
 
 	ati_remote = kzalloc(sizeof (struct ati_remote), GFP_KERNEL);
 	rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE);
Signature · 1 line
2.16.4