OSDN Git Service

greybus: loopback: fix the type attribute check
authorAlex Elder <elder@linaro.org>
Tue, 12 May 2015 02:16:34 +0000 (21:16 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 12 May 2015 17:25:14 +0000 (10:25 -0700)
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>
drivers/staging/greybus/loopback.c

index 9860d64..20aabeb 100644 (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;