Skip to content
Commit 60e2dde1 authored by Wenwen Wang's avatar Wenwen Wang Committed by Jacek Anaszewski
Browse files

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: 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>
parent 3881a72f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment