media: dvb-usb-v2: lmedm04: Improve logic checking of warm start
commit3d932ee27e852e4904647f15b64dedca51187ad7
authorMalcolm Priestley <tvboxspy@gmail.com>
Tue, 26 Sep 2017 21:10:20 +0000 (26 17:10 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 11 Dec 2017 12:51:39 +0000 (11 07:51 -0500)
tree2d799035b8bdcef617c018872129f03ddfe23f46
parent1e6f57b2b4ef75fef59ee8771c95bbaf2b086af7
media: dvb-usb-v2: lmedm04: Improve logic checking of warm start

Warm start has no check as whether a genuine device has
connected and proceeds to next execution path.

Check device should read 0x47 at offset of 2 on USB descriptor read
and it is the amount requested of 6 bytes.

Fix for
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access as

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/dvb-usb-v2/lmedm04.c