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

Commit e497ec26 authored by Wenwen Wang's avatar Wenwen Wang Committed by Greg Kroah-Hartman
Browse files

led: triggers: Fix a memory leak bug



[ Upstream commit 60e2dde1e91ae0addb21ac380cc36ebee7534e49 ]

In led_trigger_set(), 'event' is allocated in kasprintf(). However, it is
not deallocated in the following execution if the label 'err_activate' or
'err_add_groups' is entered, leading to memory leaks. To fix this issue,
free 'event' before returning the error.

Fixes: 52c47742 ("leds: triggers: send uevent when changing triggers")
Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 83c2a42b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment