OSDN Git Service

[media] gspca: konica: add missing endpoint sanity check
authorJohan Hovold <johan@kernel.org>
Mon, 13 Mar 2017 12:53:59 +0000 (09:53 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 5 Apr 2017 18:07:31 +0000 (15:07 -0300)
commitaa58fedb8c7b6cf2f05941d238495f9e2f29655c
treedf9ba8889eb163b68126878e641b28c2ace1715f
parent6ea87867e552500b242cd5be3590d6c1ff91f508
[media] gspca: konica: add missing endpoint sanity check

Make sure to check the number of endpoints to avoid accessing memory
beyond the endpoint array should a device lack the expected endpoints.

Note that, as far as I can tell, the gspca framework has already made
sure there is at least one endpoint in the current alternate setting so
there should be no risk for a NULL-pointer dereference here.

Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for
konica chipset using cams")

Cc: stable <stable@vger.kernel.org> # 2.6.37
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/gspca/konica.c