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

Commit 2aa114c3 authored by Clarence Ip's avatar Clarence Ip Committed by Steve Cohen
Browse files

drm/msm/sde: limit log filter scan to function name



Stop scanning for debug log filter matches at the end
of function names, rather than accessing extra bytes
past the string.

Change-Id: I6fe06e7a6263a37146067e4347f371650fa51b91
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent bec74282
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -34,19 +34,21 @@ static bool _sde_evtlog_is_filtered_no_lock(
		struct sde_dbg_evtlog *evtlog, const char *str)
{
	struct sde_evtlog_filter *filter_node;
	size_t len;
	bool rc;

	if (!str)
		return true;

	len = strlen(str);

	/*
	 * Filter the incoming string IFF the list is not empty AND
	 * a matching entry is not in the list.
	 */
	rc = !list_empty(&evtlog->filter_list);
	list_for_each_entry(filter_node, &evtlog->filter_list, list)
		if (strnstr(str, filter_node->filter,
					SDE_EVTLOG_FILTER_STRSIZE - 1)) {
		if (strnstr(str, filter_node->filter, len)) {
			rc = false;
			break;
		}