mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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>
This commit is contained in:
parent
d475866eee
commit
72d6cbb533
@ -1168,7 +1168,7 @@ static int smb_direct_post_send_data(struct smb_direct_transport *t,
|
||||
pr_err("failed to map buffer\n");
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
} else if (sg_cnt + msg->num_sge > SMB_DIRECT_MAX_SEND_SGES - 1) {
|
||||
} else if (sg_cnt + msg->num_sge > SMB_DIRECT_MAX_SEND_SGES) {
|
||||
pr_err("buffer not fitted into sges\n");
|
||||
ret = -E2BIG;
|
||||
ib_dma_unmap_sg(t->cm_id->device, sg, sg_cnt,
|
||||
|
Loading…
Reference in New Issue
Block a user