[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110620115441.48d3544a@lxorguk.ukuu.org.uk>
Date: Mon, 20 Jun 2011 11:54:41 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Russ Gorby <russ.gorby@...el.com>
Cc: Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org,
suhail.ahmed@...el.com
Subject: Re: [PATCH 2/2] tty: n_gsm: Added refcount usage to gsm_mux and
gsm_dlci structs
On Thu, 16 Jun 2011 14:20:13 -0700
Russ Gorby <russ.gorby@...el.com> wrote:
> The gsm_mux is created/destroyed when ldisc is
> opened/closed but clients of the MUX channel devices (gsmttyN)
> may access this structure as long as the TTYs are open.
> For the open, the ldisc open is guaranteed to preceed the TTY open,
> but the close has no such guaranteed ordering. As a result,
> the gsm_mux can be freed in the ldisc close before being accessed
> by one of the TTY clients. This can happen if the ldisc is removed
> while there are open, active MUX channels.
> A similar situation exists for DLCI-0, it is basically a resource
> shared by MUX and DLCI , and should not be freed while they can
> be accessed
>
> To avoid this, gsm_mux and dlcis now have a reference counter
> ldisc open takes a reference on the mux and all the dlcis
> gsmtty_open takes a reference on the mux, dlci0 and its specific
> dlci. Dropping the last reference initiates the actual free.
>
> Signed-off-by: Russ Gorby <russ.gorby@...el.com>
Both Acked-by: Alan Cox <alan@...ux.intel.com>
There are some possible bits of tidying up but they can be dealt with in
the future.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists