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

Commit be06049e authored by Saurabh Ambulkar's avatar Saurabh Ambulkar Committed by Gerrit - the friendly Code Review server
Browse files

coresight: Add Null check before accessing pointer buf



Add NULL check to avoid potential NULL pointer dereference for
"buf"  pointer.

Change-Id: I80b29fdacfd8a95a895a32f30b99eb00b3fc2f55
Signed-off-by: default avatarSaurabh Ambulkar <sambulka@codeaurora.org>
parent c688b1ea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -237,6 +237,9 @@ static int tmc_enable_etf_sink_perf(struct coresight_device *csdev, void *data)
	struct perf_output_handle *handle = data;
	struct cs_buffers *buf = etm_perf_sink_config(handle);

	if (!buf)
		return -EINVAL;

	spin_lock_irqsave(&drvdata->spinlock, flags);
	do {
		ret = -EINVAL;