On Thu, Mar 18, 2021 at 12:03:05PM +0200, Leon Romanovsky wrote: > +/** > + * ib_cancel_mad - Cancels an outstanding send MAD operation. > + * @send_buf: Indicates the MAD to cancel. > + * > + * MADs will be returned to the user through the corresponding > + * ib_mad_send_handler. > + */ > +static inline void ib_cancel_mad(struct ib_mad_send_buf *send_buf) > +{ > + ib_modify_mad(send_buf->mad_agent, send_buf, 0); This needs to check for a NULL send_buf, most of the calls are just blindly passing cm_priv_id->msg which can become NULL in a racey way in a few places. Jason