mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 12:16:29 -04:00
greybus: loopback: fix the type attribute check
In gb_loopback_check_attr(), the value of gb->type is checked for validity. The only valid values are 0, 1, and 2. But the check allows the value 3. Fix that. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
64a54801ae
commit
a04c640e5c
@@ -123,7 +123,7 @@ static void gb_loopback_check_attr(struct gb_loopback *gb)
|
||||
{
|
||||
if (gb->ms_wait > 1000)
|
||||
gb->ms_wait = 1000;
|
||||
if (gb->type > 3)
|
||||
if (gb->type > 2)
|
||||
gb->type = 0;
|
||||
if (gb->size > GB_LOOPBACK_SIZE_MAX)
|
||||
gb->size = GB_LOOPBACK_SIZE_MAX;
|
||||
|
||||
Reference in New Issue
Block a user