Showing error 1853

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


Source:

1151        struct usb_interface        *intf;
1152        struct usb_device        *parent = udev->parent;
1153
1154        if (udev->state == USB_STATE_NOTATTACHED ||
1155                        udev->state == USB_STATE_SUSPENDED)
1156                goto done;
1157
1158        udev->do_remote_wakeup = device_may_wakeup(&udev->dev);
1159
1160        if (udev->auto_pm) {
1161                status = autosuspend_check(udev, 0);
1162                if (status < 0)
1163                        goto done;
1164        }
1165
1166        /* Suspend all the interfaces and then udev itself */
1167        if (udev->actconfig) {
1168                for (; i < udev->actconfig->desc.bNumInterfaces; i++) {
1169                        intf = udev->actconfig->interface[i];
1170                        status = usb_suspend_interface(udev, intf, msg);
1171                        if (status != 0)
1172                                break;
1173                }
1174        }
1175        if (status == 0)
1176                status = usb_suspend_device(udev, msg);
1177
1178        /* If the suspend failed, resume interfaces that did get suspended */
1179        if (status != 0) {
1180                while (--i >= 0) {
1181                        intf = udev->actconfig->interface[i];
1182                        usb_resume_interface(udev, intf, 0);
1183                }
1184
1185                /* Try another autosuspend when the interfaces aren't busy */
1186                if (udev->auto_pm)
1187                        autosuspend_check(udev, status == -EBUSY);
1188
1189        /* If the suspend succeeded then prevent any more URB submissions,
1190         * flush any outstanding URBs, and propagate the suspend up the tree.
1191         */
Show full sources