All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
To: Christophe Ricard <christophe.ricard@gmail.com>,
	Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Invalid assignment to gate in st21nfca_get_iso14443_3_uid
Date: Sat, 28 Feb 2015 16:41:39 +0800	[thread overview]
Message-ID: <54F17F43.7060605@m4x.org> (raw)

Hello,

While compiling Linux with -Wunused-but-set-parameter, gcc reported a
warning in st21nfca_get_iso14443_3_uid function, about "gate" being set
but not used [1].  By looking at the code, it is clear that "gate =
uid_skb->data;" does nothing useful.  The function is only called once,
by st21nfca_hci_target_from_gate [2], which uses the content of the uid
array which is NOT initialized by st21nfca_get_iso14443_3_uid as the
source of a memcpy [3].

My understanding of the code is that "gate = uid_skb->data;" in
st21nfca_get_iso14443_3_uid should be changed to "memcpy(gate,
uid_skb->data, uid_skb->len);".

I'm new to the NFC subsystem so I can be wrong, in which case please
tell me what I missed in my analysis.  Please Cc me when replying as I
am not subscribed to the mailing lists.

Thanks,

Nicolas


[1]
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/nfc/st21nfca/st21nfca.c?id=v4.0-rc1#n575
[2]
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/nfc/st21nfca/st21nfca.c?id=v4.0-rc1#n646
[3]
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/nfc/st21nfca/st21nfca.c?id=v4.0-rc1#n682

             reply	other threads:[~2015-02-28  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28  8:41 Nicolas Iooss [this message]
2015-03-03  4:58 ` [PATCH] NFC: st21nfca: fix st21nfca_get_iso14443_3_uid data copy Nicolas Iooss
2015-03-16 12:28   ` Nicolas Iooss
2015-03-16 17:51     ` christophe.ricard

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=54F17F43.7060605@m4x.org \
    --to=nicolas.iooss_linux@m4x.org \
    --cc=christophe.ricard@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.