Showing error 1811

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/media/video/pvrusb2/pvrusb2-hdw.c
Line in file: 3509
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

3479                /* Validate results of read request */
3480                if ((hdw->ctl_read_urb->status != 0) &&
3481                    (hdw->ctl_read_urb->status != -ENOENT) &&
3482                    (hdw->ctl_read_urb->status != -ESHUTDOWN) &&
3483                    (hdw->ctl_read_urb->status != -ECONNRESET)) {
3484                        /* USB subsystem is reporting some kind of failure
3485                           on the read */
3486                        status = hdw->ctl_read_urb->status;
3487                        if (!probe_fl) {
3488                                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
3489                                           "control-read URB failure,"
3490                                           " status=%d",
3491                                           status);
3492                        }
3493                        goto done;
3494                }
3495                if (hdw->ctl_read_urb->actual_length < read_len) {
3496                        /* Failed to read enough data */
3497                        status = -EIO;
3498                        if (!probe_fl) {
3499                                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
3500                                           "control-read URB short,"
3501                                           " expected=%d got=%d",
3502                                           read_len,
3503                                           hdw->ctl_read_urb->actual_length);
3504                        }
3505                        goto done;
3506                }
3507                /* Transfer retrieved data out from internal buffer */
3508                for (idx = 0; idx < read_len; idx++) {
3509                        ((unsigned char *)read_data)[idx] =
3510                                hdw->ctl_read_buffer[idx];
3511                }
3512        }
3513
3514 done:
3515
3516        hdw->cmd_debug_state = 0;
3517        if ((status < 0) && (!probe_fl)) {
3518                pvr2_hdw_render_useless(hdw);
3519        }
Show full sources