ipack: ipoctal: fix module reference leak
authorJohan Hovold <johan@kernel.org>
Fri, 17 Sep 2021 11:46:21 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Sep 2021 15:38:49 +0000 (17:38 +0200)
commitbb8a4fcb2136508224c596a7e665bdba1d7c3c27
tree6349a8c8cd733b11ef5281c2fb17220751f9c256
parent445c8132727728dc297492a7d9fc074af3e94ba3
ipack: ipoctal: fix module reference leak

A reference to the carrier module was taken on every open but was only
released once when the final reference to the tty struct was dropped.

Fix this by taking the module reference and initialising the tty driver
data when installing the tty.

Fixes: 82a82340bab6 ("ipoctal: get carrier driver to avoid rmmod")
Cc: stable@vger.kernel.org # 3.18
Cc: Federico Vaga <federico.vaga@cern.ch>
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210917114622.5412-6-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/devices/ipoctal.c