media: flexcop-usb: fix endpoint sanity check
commitd9bc386f317171964dd926c4ee71a966d4aa64ba
authorJohan Hovold <johan@kernel.org>
Fri, 3 Jan 2020 16:35:08 +0000 (3 17:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 13:28:21 +0000 (2 15:28 +0200)
treed7621faf4176f2733a914f0fa82a1a05442b1049
parent83f75226a7f2ed14423ae36f48a9706b16a1699e
media: flexcop-usb: fix endpoint sanity check

commit bca243b1ce0e46be26f7c63b5591dfbb41f558e5 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/b2c2/flexcop-usb.c