From: Samuel Ortiz <sameo@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: NFC: Fragment LLCP I frames
Date: Thu, 8 Mar 2012 03:49:52 +0100 [thread overview]
Message-ID: <20120308024952.GA9008@sortiz-mobl> (raw)
In-Reply-To: <20120307095142.GA24805@elgon.mountain>
Hi Dan,
On Wed, Mar 07, 2012 at 12:51:42PM +0300, Dan Carpenter wrote:
> Hi Samuel,
>
> I had some questions about the patch e65b0f46edfd: "NFC: Fragment LLCP I
> frames" from Mar 5, 2012.
>
> net/nfc/llcp/commands.c
> + while (remaining_len > 0) {
> +
> + frag_len = min_t(u16, local->remote_miu, remaining_len);
> ^^^
>
> This should be a cast to size_t. Otherwise for a large value of
> remaining_len we'd loop until we hit an allocation failure with
> pdu = llcp_allocate_pdu();
Right.
> + pdu = llcp_allocate_pdu(sock, LLCP_PDU_I,
> + frag_len + LLCP_SEQUENCE_SIZE);
> + if (pdu == NULL)
> + return -ENOMEM;
> +
> + skb_put(pdu, LLCP_SEQUENCE_SIZE);
> +
> + memcpy(skb_put(pdu, frag_len), msg_ptr, frag_len);
> +
> + skb_queue_head(&sock->tx_queue, pdu);
> +
> + lock_sock(sk);
> +
> + nfc_llcp_queue_i_frames(sock);
> +
> + release_sock(sk);
> +
> + remaining_len -= frag_len;
> + msg_ptr += len;
>
> Shouldn't this be msg_ptr += frag_len?
Right as well.
I'll send an patch to John for fixing that. Do you mind me adding a:
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
to it ?
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
next prev parent reply other threads:[~2012-03-08 2:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 9:51 NFC: Fragment LLCP I frames Dan Carpenter
2012-03-08 2:49 ` Samuel Ortiz [this message]
2012-03-08 6:46 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120308024952.GA9008@sortiz-mobl \
--to=sameo@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).