Commit 305a7e87 authored by Roland Dreier's avatar Roland Dreier

[IB] uverbs: unlock correctly in error paths

A couple of functions were missing spin_unlock calls in error paths.
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 5b6810e0
...@@ -312,8 +312,10 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context) ...@@ -312,8 +312,10 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
} }
entry = kmalloc(sizeof *entry, GFP_ATOMIC); entry = kmalloc(sizeof *entry, GFP_ATOMIC);
if (!entry) if (!entry) {
spin_unlock_irqrestore(&file->lock, flags);
return; return;
}
uobj = container_of(cq->uobject, struct ib_ucq_object, uobject); 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, ...@@ -343,8 +345,10 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
} }
entry = kmalloc(sizeof *entry, GFP_ATOMIC); entry = kmalloc(sizeof *entry, GFP_ATOMIC);
if (!entry) if (!entry) {
spin_unlock_irqrestore(&file->async_file->lock, flags);
return; return;
}
entry->desc.async.element = element; entry->desc.async.element = element;
entry->desc.async.event_type = event; entry->desc.async.event_type = event;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment