Staging: panel: Reduce value range for *name
authorKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Sun, 3 Jan 2016 19:43:27 +0000 (20:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jan 2016 06:23:38 +0000 (22:23 -0800)
out is 0-9 so it's too much for om, therefore reduce value range for
*name from '0'-'9' to '0'-'7'.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/panel/panel.c

index e9641ea7e4771c1bdef753d115ec42c9a844f32c..fcfcda7ff1f4a39621b1d407fe32dbcb10912bf4 100644 (file)
@@ -2065,7 +2065,7 @@ static u8 input_name2mask(const char *name, __u64 *mask, __u64 *value,
                im |= BIT(in);
 
                name++;
-               if (isdigit(*name)) {
+               if (*name >= '0' && *name <= '7') {
                        out = *name - '0';
                        om |= BIT(out);
                } else if (*name == '-') {