From: "Bin Luo (University of Electronic Science and Technology of China)" <luob87709@gmail.com>
To: oe-linux-nfc@lists.linux.dev
Cc: johan@kernel.org, david@ixit.cz, kuba@kernel.org,
netdev@vger.kernel.org,
"Bin Luo (University of Electronic Science and Technology of
China)" <luob87709@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH v3 2/2] nfc: preserve NCI data status error codes
Date: Mon, 23 Nov 2026 14:33:10 +0800 [thread overview]
Message-ID: <20261123063310.1267-3-luob87709@gmail.com> (raw)
In-Reply-To: <20261123063310.1267-1-luob87709@gmail.com>
nci_to_errno() returns negative errno values for nonzero data-status
bytes. Passing that value to nci_add_rx_data_frag() through a __u8
parameter truncates the errno and changes it to an unrelated positive
value before the completion callback receives it.
Keep the error parameter as int so the original errno reaches the
completion path unchanged.
Fixes: 98ff416f97c5 ("NFC: nci: Add status byte management in case of error.")
Cc: stable@vger.kernel.org
Signed-off-by: Bin Luo (University of Electronic Science and Technology of China) <luob87709@gmail.com>
---
v3:
- Split the signed NCI status errno correction into a separate patch.
net/nfc/nci/data.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 3bbebb950..4a2326a33 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -213,13 +213,11 @@ EXPORT_SYMBOL(nci_send_data);
static void nci_add_rx_data_frag(struct nci_dev *ndev,
struct sk_buff *skb,
- __u8 pbf, __u8 conn_id, __u8 status)
+ __u8 pbf, __u8 conn_id, int err)
{
int reassembly_len;
- int err = 0;
- if (status) {
- err = status;
+ if (err) {
kfree_skb(ndev->rx_data_reassembly);
ndev->rx_data_reassembly = NULL;
goto exit;
prev parent reply other threads:[~2026-11-23 6:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 6:33 [PATCH v3 0/2] net/nfc: fix skb ownership and NCI status errors Bin Luo (University of Electronic Science and Technology of China)
2026-11-23 6:33 ` [PATCH v3 1/2] net/nfc: fix skb ownership on data exchange errors Bin Luo (University of Electronic Science and Technology of China)
2026-11-23 6:33 ` Bin Luo (University of Electronic Science and Technology of China) [this message]
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=20261123063310.1267-3-luob87709@gmail.com \
--to=luob87709@gmail.com \
--cc=david@ixit.cz \
--cc=johan@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=stable@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