]> git.baikalelectronics.ru Git - kernel.git/commit
staging: most: usb: sanity check channel before using it as an index into arrays
authorColin Ian King <colin.king@canonical.com>
Thu, 7 May 2020 15:06:52 +0000 (16:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 May 2020 11:51:12 +0000 (13:51 +0200)
commit9ea5aeb84a1a1a3d429f41e462c17f95275214c8
treea5b49387ff3ebc65a763acb77b0e62e2df5c292a
parent3016a0e81c490d4cc3a5d6c6b762e1130e2201ff
staging: most: usb: sanity check channel before using it as an index into arrays

Currently channel is being sanity checked after it has been used as
an index into some arrays. Fix this by moving the sanity check of
channel before the arrays are indexed with it.

Addresses-Coverity: ("Negative array index read")
Fixes: 1618600fb625 ("Staging: most: replace pr_*() functions by dev_*()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200507150652.52238-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/usb/usb.c