Showing error 925

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: drivers/usb/wusbcore/wa-xfer.c
Line in file: 1019
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 49fa09215c03116449184057f062c6aea2f1d0b4
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

 989        result = urb->status;
 990        if (urb->status != -EINPROGRESS)
 991                goto error_dequeued;
 992
 993        result = __wa_xfer_setup(xfer, urb);
 994        if (result < 0)
 995                goto error_xfer_setup;
 996        result = __wa_xfer_submit(xfer);
 997        if (result < 0)
 998                goto error_xfer_submit;
 999        spin_unlock_irqrestore(&xfer->lock, flags);
1000        d_fnend(3, dev, "(wa %p urb %p) = void\n", wa, urb);
1001        return;
1002
1003        /* this is basically wa_xfer_completion() broken up wa_xfer_giveback()
1004         * does a wa_xfer_put() that will call wa_xfer_destroy() and clean
1005         * upundo setup().
1006         */
1007error_xfer_setup:
1008error_dequeued:
1009        spin_unlock_irqrestore(&xfer->lock, flags);
1010        /* FIXME: segmentation broken, kills DWA */
1011        if (wusb_dev)
1012                wusb_dev_put(wusb_dev);
1013error_dev_gone:
1014        rpipe_put(xfer->ep->hcpriv);
1015error_rpipe_get:
1016        xfer->result = result;
1017        wa_xfer_giveback(xfer);
1018        d_fnend(3, dev, "(wa %p urb %p) = (void) %d\n", wa, urb, result);
1019        return;
1020
1021error_xfer_submit:
1022        done = __wa_xfer_is_done(xfer);
1023        xfer->result = result;
1024        spin_unlock_irqrestore(&xfer->lock, flags);
1025        if (done)
1026                wa_xfer_completion(xfer);
1027        d_fnend(3, dev, "(wa %p urb %p) = (void) %d\n", wa, urb, result);
1028        return;
1029}
Show full sources