From: Samuel Ortiz Date: Tue, 10 Apr 2012 17:43:03 +0000 (+0200) Subject: NFC: Fix the LLCP Tx fragmentation loop X-Git-Tag: firefly_0821_release~3680^2~2961^2~8^2~30 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b4838d12e1f3cb48c2489a0b08733b5dbf848297;p=firefly-linux-kernel-4.4.55.git NFC: Fix the LLCP Tx fragmentation loop Reported-by: Dan Carpenter Signed-off-by: Samuel Ortiz Signed-off-by: John W. Linville --- diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c index 7b76eb7192f3..ef10ffcb4b6f 100644 --- a/net/nfc/llcp/commands.c +++ b/net/nfc/llcp/commands.c @@ -474,7 +474,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, 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", frag_len, remaining_len); @@ -497,7 +497,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, release_sock(sk); remaining_len -= frag_len; - msg_ptr += len; + msg_ptr += frag_len; } kfree(msg_data);