From: Alex Elder Date: Tue, 12 May 2015 02:16:34 +0000 (-0500) Subject: greybus: loopback: fix the type attribute check X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~1550 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a04c640e5cf342a491afc06b0d931b7a046aa76b;p=karo-tx-linux.git 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 --- 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;