]> git.baikalelectronics.ru Git - kernel.git/commit
tty: n_gsm: fix resource allocation order in gsm_activate_mux()
authorDaniel Starke <daniel.starke@siemens.com>
Fri, 1 Jul 2022 12:23:32 +0000 (14:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jul 2022 12:47:06 +0000 (14:47 +0200)
commit9662669e9a62e533a4ab1aaa4e1a5b93252665e9
treeddfacb6dd34b769370e22488996244b22821d57c
parent3944c1ad4c389c22345e8f2650c795c89d78801a
tty: n_gsm: fix resource allocation order in gsm_activate_mux()

Within gsm_activate_mux() all timers and locks are initiated before the
actual resource for the control channel is allocated. This can lead to race
conditions.

Allocate the control channel DLCI object first to avoid race conditions.

Fixes: 99551fa31543 ("tty: n_gsm line discipline")
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220701122332.2039-2-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c