Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6aa08d2a authored by Tapas Dey's avatar Tapas Dey
Browse files

NFC: Fix possible NULL pointer dereference issue



Due to possible NULL pointer dereference
kw issues are seen.

Modify code and add proper NULL check to avoid
NULL pointer dereference.

Change-Id: Ie9f19fa9ac57a108575c08bdc123313eea3df49c
Signed-off-by: default avatarTapas Dey <tdey@codeaurora.org>
parent 6a2beea9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -369,10 +369,14 @@ void read_cold_reset_rsp(struct nfc_dev *nfc_dev, char *header)
			       __func__);
			goto error;
		}
	} else {
	} else if (header) {

		/* For I3C driver, header is read by the worker thread */
		memcpy(cold_reset_rsp, header, NCI_HDR_LEN);

	} else {
		pr_err("%s: - invalid or NULL header\n", __func__);
		goto error;
	}

	if ((cold_reset_rsp[0] != COLD_RESET_RSP_GID)