> + } else if (ret) > + *bad_wr = wr; Hmm... it seems a little strange to pick the first WR for no reason when the kernel didn't point at a particular work request. Maybe it would make more sense to set bad_wr to NULL in this case?