mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hrshy0629 <hongqiang601217@gmail.com>
To: krzysztof.kozlowski@canonical.com, davem@davemloft.net
Cc: kuba@kernel.org, linux-kernel@vger.kernel.org,
	hrshy0629 <hongqiang601217@gmail.com>
Subject: [PATCH] Module Name: drivers/nfc/pn544/pn544.c    fix a bug
Date: Sat, 25 Dec 2021 21:27:28 +0800	[thread overview]
Message-ID: <20211225132728.25111-1-hongqiang601217@gmail.com> (raw)

    I noticed that the same usage for API nfc_hci_send_cmd() in line 541 and line 552 of the file pn544.c.
    And the variable r is checked on line 545 but not checked on line 552.
    The r in line 552 should be checked.

Signed-off-by: hrshy0629 <hongqiang601217@gmail.com>
---
 drivers/nfc/pn544/pn544.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c
index 32a61a185142..531eda0d11a2 100644
--- a/drivers/nfc/pn544/pn544.c
+++ b/drivers/nfc/pn544/pn544.c
@@ -552,6 +552,8 @@ static int pn544_hci_complete_target_discovered(struct nfc_hci_dev *hdev,
 			r = nfc_hci_send_cmd(hdev, PN544_RF_READER_F_GATE,
 					     PN544_RF_READER_CMD_ACTIVATE_NEXT,
 					     uid_skb->data, uid_skb->len, NULL);
+			if (r < 0)
+				return r;
 			kfree_skb(uid_skb);
 		}
 	} else if (target->supported_protocols & NFC_PROTO_ISO14443_MASK) {
-- 
2.17.1


             reply	other threads:[~2021-12-25 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-25 13:27 hrshy0629 [this message]
2021-12-26 11:31 ` Krzysztof Kozlowski

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=20211225132728.25111-1-hongqiang601217@gmail.com \
    --to=hongqiang601217@gmail.com \
    --cc=davem@davemloft.net \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®