perf/core: Fix potential NULL deref
commit a71ef31485bb51b846e8db8b3a35e432cc15afb5 upstream. Smatch is awesome. Fixes: 32671e3799ca ("perf: Disallow mis-matched inherited group reads") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
984ee4d4bd
commit
c9e02711e7
@ -11629,7 +11629,8 @@ static int inherit_group(struct perf_event *parent_event,
|
||||
if (IS_ERR(child_ctr))
|
||||
return PTR_ERR(child_ctr);
|
||||
}
|
||||
leader->group_generation = parent_event->group_generation;
|
||||
if (leader)
|
||||
leader->group_generation = parent_event->group_generation;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user