Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
led: triggers: Fix a memory leak bug
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: 52c4774 ("leds: triggers: send uevent when changing triggers") Signed-off-by: Wenwen Wang <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Jacek Anaszewski <[email protected]>
- Loading branch information