Re: [PATCH 04/24] tty: Fix ref counting for port krefs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 09, 2014 at 08:59:04PM -0500, Peter Hurley wrote:
> The tty core supports two models for handling tty_port lifetimes;
> the tty_port can use the kref supplied by tty_port (which will
> automatically destruct the tty_port when the ref count drops to
> zero) or it can destruct the tty_port manually.
> 
> For tty drivers that choose to use the port kref to manage the
> tty_port lifetime, it is not possible to safely acquire a port
> reference conditionally. If the last reference is released after
> evaluating the condition but before acquiring the reference, a
> bogus reference will be held while the tty_port destruction
> commences.
> 
> Rather, only acquire a port reference if the ref count is non-zero
> and allow the caller to distinguish if a reference has successfully
> been acquired.
> 
> Cc: Jiri Slaby <jslaby@xxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>

Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux