Commit b4838d12 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

NFC: Fix the LLCP Tx fragmentation loop

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 673f7786
...@@ -474,7 +474,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, ...@@ -474,7 +474,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
while (remaining_len > 0) { while (remaining_len > 0) {
frag_len = min_t(u16, local->remote_miu, remaining_len); frag_len = min_t(size_t, local->remote_miu, remaining_len);
pr_debug("Fragment %zd bytes remaining %zd", pr_debug("Fragment %zd bytes remaining %zd",
frag_len, remaining_len); frag_len, remaining_len);
...@@ -497,7 +497,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, ...@@ -497,7 +497,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
release_sock(sk); release_sock(sk);
remaining_len -= frag_len; remaining_len -= frag_len;
msg_ptr += len; msg_ptr += frag_len;
} }
kfree(msg_data); kfree(msg_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment