Commit 18320828 authored by Krishna Kumar's avatar Krishna Kumar Committed by Roland Dreier

IB/uverbs: Don't free wr list when it's known to be empty

In ib_uverbs_post_send(), move the "out:" label after the loop that
frees the list of work requests, since the only place that jumps there
is before any work requests could possibly be added to the list.

This removes a compile warning: "is_ud might be used uninitialized in
this function".
Signed-off-by: default avatarKrishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 52ab3f3d
...@@ -1530,7 +1530,6 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file, ...@@ -1530,7 +1530,6 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
out_put: out_put:
put_qp_read(qp); put_qp_read(qp);
out:
while (wr) { while (wr) {
if (is_ud && wr->wr.ud.ah) if (is_ud && wr->wr.ud.ah)
put_ah_read(wr->wr.ud.ah); put_ah_read(wr->wr.ud.ah);
...@@ -1539,6 +1538,7 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file, ...@@ -1539,6 +1538,7 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
wr = next; wr = next;
} }
out:
kfree(user_wr); kfree(user_wr);
return ret ? ret : in_len; return ret ? ret : in_len;
......
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