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

Commit 93f48954 authored by David Dai's avatar David Dai
Browse files

msm: msm_bus_dbg: do not create dbgfs handles



Remove the portion during probe where we access a list of client owned
memory to create a set of debugfs files in order to prevent
an access after free during boot up. This is resulting from some client
that fails to unregister as part of their probe failure handling after
registering with the bus driver.

Change-Id: I8f30ee09ea409933a1be7abb1748b26616cb7586
Signed-off-by: default avatarDavid Dai <daidavid1@codeaurora.org>
parent b058dd78
Loading
Loading
Loading
Loading
+1 −24
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2010-2012, 2014-2018, The Linux Foundation. All rights
 * Copyright (c) 2010-2012, 2014-2019, The Linux Foundation. All rights
 */

#define pr_fmt(fmt) "AXI: %s(): " fmt, __func__
@@ -833,7 +833,6 @@ static int __init msm_bus_debugfs_init(void)
{
	struct dentry *commit, *shell_client, *rules_dbg;
	struct msm_bus_fab_list *fablist;
	struct msm_bus_cldata *cldata = NULL;
	uint64_t val = 0;

	dir = debugfs_create_dir("msm-bus-dbg", NULL);
@@ -895,28 +894,6 @@ static int __init msm_bus_debugfs_init(void)
		goto err;
	}

	rt_mutex_lock(&msm_bus_dbg_cllist_lock);
	list_for_each_entry(cldata, &cl_list, list) {
		if (cldata->pdata) {
			if (cldata->pdata->name == NULL) {
				MSM_BUS_DBG("Client name not found\n");
				continue;
			}
			cldata->file = msm_bus_dbg_create(cldata->pdata->name,
					0444, clients, cldata->clid);
		} else if (cldata->handle) {
			if (cldata->handle->name == NULL) {
				MSM_BUS_DBG("Client doesn't have a name\n");
				continue;
			}
			cldata->file = debugfs_create_file(cldata->handle->name,
							0444, clients,
							(void *)cldata->handle,
							&client_data_fops);
		}
	}
	rt_mutex_unlock(&msm_bus_dbg_cllist_lock);

	if (debugfs_create_file("dump_clients", 0644,
		clients, NULL, &msm_bus_dbg_dump_clients_fops) == NULL)
		goto err;