Skip to content

Commit 72d6cbb

Browse files
hcleeSteve French
authored andcommitted
ksmbd: smbd: fix dma mapping error in smb_direct_post_send_data
Becase smb direct header is mapped and msg->num_sge already is incremented, the decrement should be removed from the condition. Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent d475866 commit 72d6cbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ksmbd/transport_rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ static int smb_direct_post_send_data(struct smb_direct_transport *t,
11681168
pr_err("failed to map buffer\n");
11691169
ret = -ENOMEM;
11701170
goto err;
1171-
} else if (sg_cnt + msg->num_sge > SMB_DIRECT_MAX_SEND_SGES - 1) {
1171+
} else if (sg_cnt + msg->num_sge > SMB_DIRECT_MAX_SEND_SGES) {
11721172
pr_err("buffer not fitted into sges\n");
11731173
ret = -E2BIG;
11741174
ib_dma_unmap_sg(t->cm_id->device, sg, sg_cnt,

0 commit comments

Comments
 (0)