From a04c640e5cf342a491afc06b0d931b7a046aa76b Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Mon, 11 May 2015 21:16:34 -0500 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 9860d64e50ba..20aabebf0140 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -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; -- 2.39.5