There are error cases in the kernel's uverbs work request posting
functions where the return value is negative (i.e., an error) and yet a
non-zero resp.bad_wr is not written back to userspace. In this case,
ibv_cmd_post_send() should still set the bad_wr pointer.
Bug pointed out in ibv_post_send() by Ralph Campbell
<ralph.campbell@qlogic.com>, and noticed elsewhere by Dotan Barak
<dotanb@dev.mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
while (--wr_count)
i = i->next;
*bad_wr = i;
- }
+ } else if (ret)
+ *bad_wr = wr;
return ret;
}
while (--wr_count)
i = i->next;
*bad_wr = i;
- }
+ } else if (ret)
+ *bad_wr = wr;
return ret;
}
while (--wr_count)
i = i->next;
*bad_wr = i;
- }
+ } else if (ret)
+ *bad_wr = wr;
return ret;
}