ipack: ipoctal: fix tty registration race
authorJohan Hovold <johan@kernel.org>
Fri, 17 Sep 2021 11:46:18 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:56:00 +0000 (15:56 +0200)
commitf46e5db92fa2c28724724a39f1f51e8ca6a78de9
tree09bde9421421d14a3d25e9ed9e391a9e42753c23
parent5f6a309a699675680df15d9b6d389114515b4426
ipack: ipoctal: fix tty registration race

commit 65c001df517a7bf9be8621b53d43c89f426ce8d6 upstream.

Make sure to set the tty class-device driver data before registering the
tty to avoid having a racing open() dereference a NULL pointer.

Fixes: 9c1d784afc6f ("Staging: ipack/devices/ipoctal: Get rid of ipoctal_list.")
Cc: stable@vger.kernel.org # 3.7
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210917114622.5412-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/devices/ipoctal.c