USB: oxu210hp: release spinlock on error path
authorDan Carpenter <error27@gmail.com>
Mon, 29 Mar 2010 09:01:27 +0000 (12:01 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 Apr 2010 16:25:11 +0000 (09:25 -0700)
Smatch complained about this missing spinlock.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/oxu210hp-hcd.c

index 50f57f4..e62b30b 100644 (file)
@@ -660,13 +660,13 @@ static struct ehci_qh *oxu_qh_alloc(struct oxu_hcd *oxu)
                if (qh->dummy == NULL) {
                        oxu_dbg(oxu, "no dummy td\n");
                        oxu->qh_used[i] = 0;
-
-                       return NULL;
+                       qh = NULL;
+                       goto unlock;
                }
 
                oxu->qh_used[i] = 1;
        }
-
+unlock:
        spin_unlock(&oxu->mem_lock);
 
        return qh;