Unverified Commit c18ce060 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5191 [sync] PR-5164: nfc: nci: assert requested protocol is valid

parents b2f3ba69 8fda4913
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -894,6 +894,11 @@ static int nci_activate_target(struct nfc_dev *nfc_dev,
		return -EINVAL;
	}

	if (protocol >= NFC_PROTO_MAX) {
		pr_err("the requested nfc protocol is invalid\n");
		return -EINVAL;
	}

	if (!(nci_target->supported_protocols & (1 << protocol))) {
		pr_err("target does not support the requested protocol 0x%x\n",
		       protocol);