Skip to content

Commit

Permalink
[IB] uverbs: unlock correctly in error paths
Browse files Browse the repository at this point in the history
A couple of functions were missing spin_unlock calls in error paths.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Oct 17, 2005
1 parent 5b6810e commit 305a7e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 305a7e8

Please sign in to comment.