diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 9e378d0a0c01..2ecadd309f4a 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1767,6 +1767,21 @@ static void nvme_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
return;
}
+ /* received data length checking */
+ if (unlikely(wc->byte_len < len)) {
+ /* zero bytes message could be ignored */
+ if (!wc->byte_len) {
+ nvme_rdma_post_recv(queue, qe);
+ return;
+ }