Input: ims-pcu - validate number of endpoints before using them
authorJohan Hovold <johan@kernel.org>
Thu, 16 Mar 2017 18:36:13 +0000 (11:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2017 07:41:22 +0000 (09:41 +0200)
commit1f5a512844a85690df614db3a6d8dbb54e662391
tree6c129cbbcba5c0cdf0b2988c97502ceb0f8c7c14
parent0afac79f6696c78ea2006af8d39b296d285db802
Input: ims-pcu - validate number of endpoints before using them

commit 1916d319271664241b7aa0cd2b05e32bdb310ce9 upstream.

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer should a malicious device lack control-interface endpoints.

Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/misc/ims-pcu.c