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:
Alex Elder 2015-05-11 21:16:34 -05:00 committed by Greg Kroah-Hartman
parent 64a54801ae
commit a04c640e5c

View File

@ -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;