usb: wusbcore: clean up the sg list that was created for out transfers
authorThomas Pugliese <thomas.pugliese@gmail.com>
Thu, 26 Sep 2013 19:08:15 +0000 (14:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 23:31:37 +0000 (16:31 -0700)
Clean up the SG list after transfer completetion for out transfers if one
was created by the HWA.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/wusbcore/wa-xfer.c

index f614fb1..61b0597 100644 (file)
@@ -520,6 +520,10 @@ static void wa_seg_dto_cb(struct urb *urb)
        unsigned rpipe_ready = 0;
        u8 done = 0;
 
+       /* free the sg if it was used. */
+       kfree(urb->sg);
+       urb->sg = NULL;
+
        switch (urb->status) {
        case 0:
                spin_lock_irqsave(&xfer->lock, flags);