X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Finput%2Fmap_to_7segment.h;h=a424094d9fe21b836b5b13216147ac09fb690811;hb=a9312fb839e90668d05a90024f3a7e7ff646a4a3;hp=52ff27f15127817bb4491638193c3ea406c03937;hpb=e3e3679cfc1c6689e035f6d69606253b1eda63ca;p=linux-2.6-omap-h63xx.git diff --git a/drivers/usb/input/map_to_7segment.h b/drivers/usb/input/map_to_7segment.h index 52ff27f1512..a424094d9fe 100644 --- a/drivers/usb/input/map_to_7segment.h +++ b/drivers/usb/input/map_to_7segment.h @@ -79,7 +79,7 @@ struct seg7_conversion_map { static inline int map_to_seg7(struct seg7_conversion_map *map, int c) { - return c & 0x7f ? map->table[c] : -EINVAL; + return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL; } #define SEG7_CONVERSION_MAP(_name, _map) \