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

Commit b4328e3b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PM / devfreq: memlat: add missing alloc check in start_hwmon"

parents d680ef20 01e00127
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -338,11 +338,14 @@ static void memlat_monitor_work(struct work_struct *work)
static int start_hwmon(struct memlat_hwmon *hw)
{
	int ret = 0;
	struct perf_event_attr *attr = alloc_attr();
	unsigned int cpu;
	struct memlat_mon *mon = to_mon(hw);
	struct memlat_cpu_grp *cpu_grp = mon->cpu_grp;
	bool should_init_cpu_grp;
	struct perf_event_attr *attr = alloc_attr();

	if (!attr)
		return -ENOMEM;

	mutex_lock(&cpu_grp->mons_lock);
	should_init_cpu_grp = !(cpu_grp->num_active_mons++);