diff options
Diffstat (limited to 'drivers/media/video/gspca/stk014.c')
-rw-r--r-- | drivers/media/video/gspca/stk014.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c index 87be52b5e1e3..763747700f10 100644 --- a/drivers/media/video/gspca/stk014.c +++ b/drivers/media/video/gspca/stk014.c | |||
@@ -436,17 +436,14 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
436 | static int sd_querymenu(struct gspca_dev *gspca_dev, | 436 | static int sd_querymenu(struct gspca_dev *gspca_dev, |
437 | struct v4l2_querymenu *menu) | 437 | struct v4l2_querymenu *menu) |
438 | { | 438 | { |
439 | static const char *freq_nm[3] = {"NoFliker", "50 Hz", "60 Hz"}; | ||
440 | |||
439 | switch (menu->id) { | 441 | switch (menu->id) { |
440 | case V4L2_CID_POWER_LINE_FREQUENCY: | 442 | case V4L2_CID_POWER_LINE_FREQUENCY: |
441 | switch (menu->index) { | 443 | if ((unsigned) menu->index >= ARRAY_SIZE(freq_nm)) |
442 | case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */ | 444 | break; |
443 | strcpy((char *) menu->name, "50 Hz"); | 445 | strcpy((char *) menu->name, freq_nm[menu->index]); |
444 | return 0; | 446 | return 0; |
445 | case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */ | ||
446 | strcpy((char *) menu->name, "60 Hz"); | ||
447 | return 0; | ||
448 | } | ||
449 | break; | ||
450 | } | 447 | } |
451 | return -EINVAL; | 448 | return -EINVAL; |
452 | } | 449 | } |