Char: isicom, prolong tty reference holding
PATCH 2/2 Char: isicom, fix build warning
In reply to Jiri SlabyFix this:isicom.c: In function `isicom_probe':
isicom.c:1587: warning: `signature' may be used uninitialized in this function by uninitialized_var(), because if the signature is not initialized in reset_card(), we won't use it.
--- drivers/char/isicom.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/isicom.c +1 -1
@@ -1584,7 +1584,7 @@ static unsigned int card_count;static int __devinit isicom_probe (struct pci_dev *pdev,const struct pci_device_id *ent) { -unsigned int signature, index; +unsigned int uninitialized_var (signature ), index;int retval = -EPERM ;struct isi_board *board =NULL ;
Signature · 1 line
1.6.2
PATCH 1/2 Char: isicom, prolong tty reference holding
Hold the tty reference a bit longer in isicom_shutdown_port, because we use it later in the function, so that it won't disappear in the meantime.
--- drivers/char/isicom.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/char/isicom.c +1 -2
@@ -897,8 +897,6 @@ static void isicom_shutdown_port(struct isi_port *port)tty_port_free_xmit_buf (&port->port); port->port.flags &= ~ASYNC_INITIALIZED ; -/* 3rd October 2000 : Vinayak P Risbud */ -tty_port_tty_set (&port->port,NULL );/*Fix done by Anil .S on 30-04-2001 remote login through isi port has dtr toggle problem
@@ -925,6 +923,7 @@ static void isicom_shutdown_port(struct isi_port *port)if (!card->count)isicom_shutdown_board (card); } +tty_port_tty_set (&port->port,NULL ); }static void isicom_flush_buffer (struct tty_struct *tty)
Signature · 1 line
1.6.2
Alan Cox
NAKQuoted 3 lines · On Mon, 16 Mar 2009 11:34:24 +0100 Jiri Slaby <[email protected]> wrote:
Hold the tty reference a bit longer in
isicom_shutdown_port, because we use it later in the function, so that it won't disappear in the meantime.
NAK - we do have a bug there but I don't think that is it.
The tty_kref_get takes an additional reference so the tty_port_tty_set is fine, but we don't then drop the kref we took temporarily. I think we need this:
isicom: isicom kref leak fix
From: Alan Cox <[email protected]>
The isicom driver leaks a kref on the shutdown path. Drop the additional kref we took
---
drivers/char/isicom.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/isicom.c +1 -0
@@ -925,6 +925,7 @@ static void isicom_shutdown_port(struct isi_port *port)if (!card->count)isicom_shutdown_board (card); } +tty_kref_put (tty); }static void isicom_flush_buffer (struct tty_struct *tty)
Quoted 7 lines · Alan Cox
Quoted 3 lines · On Mon, 16 Mar 2009 11:34:24 +0100 Jiri Slaby<[email protected]> wrote:
Hold the tty reference a bit longer in
isicom_shutdown_port, because we use it later in the function, so that it won't disappear in the meantime.
Quoted 5 lines
NAK - we do have a bug there but I don't think that is it.
The
tty_kref_gettakes an additional reference so thetty_port_tty_setis fine, but we don't then drop the kref we took temporarily. I think we need this:
Hmm, but the tty_port_tty_set drops the reference, right?
Quoted 1 line · Jiri Slaby
Hmm, but the
tty_port_tty_setdrops the reference, right?
I see it. Ignore this.
Jiri Slaby
Acked-byQuoted 8 lines · Alan Cox
isicom: isicom kref leak fix
From: Alan Cox<[email protected]>
The isicom driver leaks a kref on the shutdown path. Drop the additional kref we took
Signed-off-by Alan Cox<[email protected]>