r8152: check the informaton of the device
authorHayes Wang <hayeswang@realtek.com>
Mon, 24 May 2021 06:49:42 +0000 (14:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 20:15:29 +0000 (13:15 -0700)
commit1a44fb38cc65bc30bac490291412aa1940659fe1
treea3c458b7802e7f2ba058efddde1f10bb17f198b5
parent9b76eade16423ef06829cccfe3e100cfce31afcd
r8152: check the informaton of the device

Verify some fields of the USB descriptor to make sure the driver
could be used by the device.

Besides, remove the check of endpoint number in rtl8152_probe().
usb_find_common_endpoints() includes it.

BugLink: https://syzkaller.appspot.com/bug?id=912c9c373656996801b4de61f1e3cb326fe940aa
Reported-by: syzbot+95afd23673f5dd295c57@syzkaller.appspotmail.com
Fixes: c2198943e33b ("r8152: search the configuration of vendor mode")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/r8152.c