Skip to contentSkip to conversation

question about tty_port.c

DISCUSSION gianluca 1 participant 1 message Jul 5, 2013 TTY layer and serial drivers

lore
Share & tools
lore

gianluca

author
#0 lore raw

Hi,

I was getting kernel panics using an rfcomm bluetooth serial port with the kernel 3.10 and searching the web I stumbled upon the following issue, which seems to be exactly the problem I have:

http://marc.info/?t=136868685500006&r=1&w=2

So I went to look tty_port.c to understand the lifetime of the tty_port objects and fix rfcomm/tty.c

This is unrelated to the issue I have but it seems to me that in tty_port_tty_hangup we could leak a tty object:

        if (tty && (!check_clocal || !C_CLOCAL(tty))) {
                tty_hangup(tty);
                tty_kref_put(tty);
        }

If the first condition is true (tty != NULL) and the second is false we never call tty_kref_put.

However I could be wrong and in this case I apologize.

I don't understand the inner working of this code, I was just trying to fix the oops I get, without luck unfortunately.

Ciao,

Gianluca