]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IB] uverbs: unlock correctly in error paths
authorRoland Dreier <rolandd@cisco.com>
Tue, 11 Oct 2005 22:39:38 +0000 (15:39 -0700)
committerRoland Dreier <rolandd@cisco.com>
Mon, 17 Oct 2005 22:20:29 +0000 (15:20 -0700)
A couple of functions were missing spin_unlock calls in error paths.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/uverbs_main.c

index c84cc28b60ee4bfc43307a5dd8c24f0088aad01e..3a887006b2539a9c97726de11ecdfcb636a225d8 100644 (file)
@@ -312,8 +312,10 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
        }
 
        entry = kmalloc(sizeof *entry, GFP_ATOMIC);
-       if (!entry)
+       if (!entry) {
+               spin_unlock_irqrestore(&file->lock, flags);
                return;
+       }
 
        uobj = container_of(cq->uobject, struct ib_ucq_object, uobject);
 
@@ -343,8 +345,10 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
        }
 
        entry = kmalloc(sizeof *entry, GFP_ATOMIC);
-       if (!entry)
+       if (!entry) {
+               spin_unlock_irqrestore(&file->async_file->lock, flags);
                return;
+       }
 
        entry->desc.async.element    = element;
        entry->desc.async.event_type = event;