Commit a04c640e authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman
Browse files

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 64a54801
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;