media: flexcop-usb: fix endpoint sanity check
authorJohan Hovold <johan@kernel.org>
Fri, 3 Jan 2020 16:35:08 +0000 (17:35 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 24 Feb 2020 15:23:28 +0000 (16:23 +0100)
commitbca243b1ce0e46be26f7c63b5591dfbb41f558e5
treeacb14035e16669d5e02c0541f3b3d991a1dc8d0d
parent7e0cfdadd1aafdb6963291b65358e60a7af3a4cf
media: flexcop-usb: fix endpoint sanity check

commit 1b976fc6d684 ("media: b2c2-flexcop-usb: add sanity checking") added
an endpoint sanity check to address a NULL-pointer dereference on probe.
Unfortunately the check was done on the current altsetting which was later
changed.

Fix this by moving the sanity check to after the altsetting is changed.

Fixes: 1b976fc6d684 ("media: b2c2-flexcop-usb: add sanity checking")
Cc: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/b2c2/flexcop-usb.c