diff options
Diffstat (limited to 'drivers/staging/easycap/easycap_ioctl.c')
-rw-r--r-- | drivers/staging/easycap/easycap_ioctl.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c index 2f9b3eab489..447953a4e80 100644 --- a/drivers/staging/easycap/easycap_ioctl.c +++ b/drivers/staging/easycap/easycap_ioctl.c | |||
@@ -977,9 +977,13 @@ if (NULL == file) { | |||
977 | } | 977 | } |
978 | peasycap = file->private_data; | 978 | peasycap = file->private_data; |
979 | if (NULL == peasycap) { | 979 | if (NULL == peasycap) { |
980 | SAY("ERROR: peasycap is NULL.\n"); | 980 | SAY("ERROR: peasycap is NULL\n"); |
981 | return -1; | 981 | return -1; |
982 | } | 982 | } |
983 | if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { | ||
984 | SAY("ERROR: bad peasycap\n"); | ||
985 | return -EFAULT; | ||
986 | } | ||
983 | p = peasycap->pusb_device; | 987 | p = peasycap->pusb_device; |
984 | if (NULL == p) { | 988 | if (NULL == p) { |
985 | SAM("ERROR: peasycap->pusb_device is NULL\n"); | 989 | SAM("ERROR: peasycap->pusb_device is NULL\n"); |
@@ -1012,6 +1016,11 @@ if (0 <= kd && DONGLE_MANY > kd) { | |||
1012 | mutex_unlock(&easycap_dongle[kd].mutex_video); | 1016 | mutex_unlock(&easycap_dongle[kd].mutex_video); |
1013 | return -ERESTARTSYS; | 1017 | return -ERESTARTSYS; |
1014 | } | 1018 | } |
1019 | if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { | ||
1020 | SAY("ERROR: bad peasycap\n"); | ||
1021 | mutex_unlock(&easycap_dongle[kd].mutex_video); | ||
1022 | return -EFAULT; | ||
1023 | } | ||
1015 | p = peasycap->pusb_device; | 1024 | p = peasycap->pusb_device; |
1016 | if (NULL == peasycap->pusb_device) { | 1025 | if (NULL == peasycap->pusb_device) { |
1017 | SAM("ERROR: peasycap->pusb_device is NULL\n"); | 1026 | SAM("ERROR: peasycap->pusb_device is NULL\n"); |
@@ -2297,7 +2306,7 @@ case VIDIOC_DQBUF: | |||
2297 | ((long long int)(timeval.tv_sec - \ | 2306 | ((long long int)(timeval.tv_sec - \ |
2298 | timeval2.tv_sec)) + \ | 2307 | timeval2.tv_sec)) + \ |
2299 | (long long int)(timeval.tv_usec - \ | 2308 | (long long int)(timeval.tv_usec - \ |
2300 | timeval2.tv_usec); | 2309 | timeval2.tv_usec); |
2301 | sdr = signed_div(fudge, 1000); | 2310 | sdr = signed_div(fudge, 1000); |
2302 | sll = sdr.quotient; | 2311 | sll = sdr.quotient; |
2303 | ull = sdr.remainder; | 2312 | ull = sdr.remainder; |
@@ -2317,6 +2326,8 @@ case VIDIOC_DQBUF: | |||
2317 | JOM(16, " %10i=bytesused\n", v4l2_buffer.bytesused); | 2326 | JOM(16, " %10i=bytesused\n", v4l2_buffer.bytesused); |
2318 | JOM(16, " 0x%08X=flags\n", v4l2_buffer.flags); | 2327 | JOM(16, " 0x%08X=flags\n", v4l2_buffer.flags); |
2319 | JOM(16, " %10i=field\n", v4l2_buffer.field); | 2328 | JOM(16, " %10i=field\n", v4l2_buffer.field); |
2329 | JOM(16, " %10li=timestamp.tv_sec\n", \ | ||
2330 | (long)v4l2_buffer.timestamp.tv_sec); | ||
2320 | JOM(16, " %10li=timestamp.tv_usec\n", \ | 2331 | JOM(16, " %10li=timestamp.tv_usec\n", \ |
2321 | (long)v4l2_buffer.timestamp.tv_usec); | 2332 | (long)v4l2_buffer.timestamp.tv_usec); |
2322 | JOM(16, " %10i=sequence\n", v4l2_buffer.sequence); | 2333 | JOM(16, " %10i=sequence\n", v4l2_buffer.sequence); |
@@ -2528,6 +2539,10 @@ if (NULL == peasycap) { | |||
2528 | SAY("ERROR: peasycap is NULL.\n"); | 2539 | SAY("ERROR: peasycap is NULL.\n"); |
2529 | return -EFAULT; | 2540 | return -EFAULT; |
2530 | } | 2541 | } |
2542 | if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { | ||
2543 | SAY("ERROR: bad peasycap\n"); | ||
2544 | return -EFAULT; | ||
2545 | } | ||
2531 | p = peasycap->pusb_device; | 2546 | p = peasycap->pusb_device; |
2532 | if (NULL == p) { | 2547 | if (NULL == p) { |
2533 | SAM("ERROR: peasycap->pusb_device is NULL\n"); | 2548 | SAM("ERROR: peasycap->pusb_device is NULL\n"); |
@@ -2560,6 +2575,11 @@ if (0 <= kd && DONGLE_MANY > kd) { | |||
2560 | mutex_unlock(&easycap_dongle[kd].mutex_audio); | 2575 | mutex_unlock(&easycap_dongle[kd].mutex_audio); |
2561 | return -ERESTARTSYS; | 2576 | return -ERESTARTSYS; |
2562 | } | 2577 | } |
2578 | if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { | ||
2579 | SAY("ERROR: bad peasycap\n"); | ||
2580 | mutex_unlock(&easycap_dongle[kd].mutex_audio); | ||
2581 | return -EFAULT; | ||
2582 | } | ||
2563 | p = peasycap->pusb_device; | 2583 | p = peasycap->pusb_device; |
2564 | if (NULL == peasycap->pusb_device) { | 2584 | if (NULL == peasycap->pusb_device) { |
2565 | SAM("ERROR: peasycap->pusb_device is NULL\n"); | 2585 | SAM("ERROR: peasycap->pusb_device is NULL\n"); |
@@ -2795,3 +2815,5 @@ mutex_unlock(&easycap_dongle[kd].mutex_audio); | |||
2795 | return 0; | 2815 | return 0; |
2796 | } | 2816 | } |
2797 | /*****************************************************************************/ | 2817 | /*****************************************************************************/ |
2818 | |||
2819 | |||