Re: [PATCH 06/14] tty/serial/core: Introduce poll_init callback

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

 



> +	tport = &state->port;
> +	if (!(tport->flags & ASYNC_INITIALIZED) && port->ops->poll_init) {
> +		mutex_lock(&tport->mutex);
> +		ret = port->ops->poll_init(port);
> +		/*
> +		 * We don't set ASYNCB_INITIALIZED as we only initialized the
> +		 * hw, e.g. state->xmit is still uninitialized.
> +		 */
> +		mutex_unlock(&tport->mutex);
> +		if (ret)
> +			return ret;
> +	}

What stops a parallel open or close changing ASYNC_INITIALIZED after you
test and before you lock ?

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


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux