]> git.baikalelectronics.ru Git - kernel.git/commit
leds: trigger: Fix error path to not unlock the unlocked mutex
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 19 Feb 2021 13:33:06 +0000 (14:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:27:55 +0000 (09:27 +0100)
commit0291604c35ea3050e489d1f689648b2f84876baf
tree25f6e9edae325a8af3e9d57fa98b28f6a30879a1
parent219c9076286fd92026e818ab1375558e5b20649f
leds: trigger: Fix error path to not unlock the unlocked mutex

ttyname is allocated before the mutex is taken, so it must not be
unlocked in the error path.

Fixes: 396d71de5bc6 ("leds: trigger: implement a tty trigger")
Reported-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210219133307.4840-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/leds/trigger/ledtrig-tty.c