Re: [patch 0/1] fix async usb removal

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

 



Hi,

On Mon, Aug 07, 2017 at 11:18:44PM +0200, Samuel Thibault wrote:
> >  static void spk_ttyio_send_xchar(char ch)
> >  {
> > +	if (check_tty(speakup_tty))
> > +		return;
> > +
> >  	speakup_tty->ops->send_xchar(speakup_tty, ch);
> >  }
> 
> This is still unsafe: the unplug might come just between testing for
> speakup_tty becoming NULL and using it.

I thought about that but couldn't find a way to overcome it in a
foolproof way. Here's my reasoning. Since the unplugging of usb is
asynchronous to us calling methods on speakup_tty, speakup_tty can
become null in a separate thread. In situation where usb is unplugged
immediately before we call a method on speakup_tty, even if we
deactivate speakup the method on null speakup_tty will still be called.

Have I missed something?

Thanks,
Okash
_______________________________________________
Speakup mailing list
Speakup@xxxxxxxxxxxxxxxxx
http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux