.. | .. |
---|
222 | 222 | spin_lock_irq(&ev_queue->lock); |
---|
223 | 223 | |
---|
224 | 224 | while (list_empty(&ev_queue->event_list)) { |
---|
225 | | - spin_unlock_irq(&ev_queue->lock); |
---|
| 225 | + if (ev_queue->is_closed) { |
---|
| 226 | + spin_unlock_irq(&ev_queue->lock); |
---|
| 227 | + return -EIO; |
---|
| 228 | + } |
---|
226 | 229 | |
---|
| 230 | + spin_unlock_irq(&ev_queue->lock); |
---|
227 | 231 | if (filp->f_flags & O_NONBLOCK) |
---|
228 | 232 | return -EAGAIN; |
---|
229 | 233 | |
---|
.. | .. |
---|
233 | 237 | return -ERESTARTSYS; |
---|
234 | 238 | |
---|
235 | 239 | spin_lock_irq(&ev_queue->lock); |
---|
236 | | - |
---|
237 | | - /* If device was disassociated and no event exists set an error */ |
---|
238 | | - if (list_empty(&ev_queue->event_list) && ev_queue->is_closed) { |
---|
239 | | - spin_unlock_irq(&ev_queue->lock); |
---|
240 | | - return -EIO; |
---|
241 | | - } |
---|
242 | 240 | } |
---|
243 | 241 | |
---|
244 | 242 | event = list_entry(ev_queue->event_list.next, struct ib_uverbs_event, list); |
---|
.. | .. |
---|
537 | 535 | if (hdr->in_words * 4 != count) |
---|
538 | 536 | return -EINVAL; |
---|
539 | 537 | |
---|
540 | | - if (count < method_elm->req_size + sizeof(hdr)) { |
---|
| 538 | + if (count < method_elm->req_size + sizeof(*hdr)) { |
---|
541 | 539 | /* |
---|
542 | 540 | * rdma-core v18 and v19 have a bug where they send DESTROY_CQ |
---|
543 | 541 | * with a 16 byte write instead of 24. Old kernels didn't |
---|