From: Oliver Neukum <[email protected]>

[ Upstream commit a8be80053ea74bd9c3f9a3810e93b802236d6498 ]

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

Reported-by: [email protected]
Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
 drivers/media/rc/ati_remote.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index d0871d60a7231..8e3af398a6c4e 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -845,6 +845,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);
-- 
2.25.1



Reply via email to