Skip to content

Commit

Permalink
IB/uverbs: Don't free wr list when it's known to be empty
Browse files Browse the repository at this point in the history
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: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Krishna Kumar authored and Roland Dreier committed Jun 22, 2006
1 parent 52ab3f3 commit 1832082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/uverbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,6 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
out_put:
put_qp_read(qp);

out:
while (wr) {
if (is_ud && wr->wr.ud.ah)
put_ah_read(wr->wr.ud.ah);
Expand All @@ -1539,6 +1538,7 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
wr = next;
}

out:
kfree(user_wr);

return ret ? ret : in_len;
Expand Down

0 comments on commit 1832082

Please sign in to comment.