diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 954b1b129..c71b7463f 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -3531,8 +3531,11 @@ static int srpt_xfer_data(struct srpt_rdma_ch *ch, int ret; if (ioctx->imm_data) { - BUG_ON(!srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA, - SRPT_STATE_DATA_IN)); + bool res; + + res = srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA, + SRPT_STATE_DATA_IN); + BUG_ON(!res); if (unlikely(!scst_cmd_get_tgt_data_buff_alloced(cmd))) { unsigned int offset = 0, len; uint8_t *buf;