Re: [PATCH v2 2/2] staging: speakup: refactor to use existing code in vt

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

 



Okash Khawaja, le mer. 03 avril 2019 00:27:43 +0100, a ecrit:
> +void speakup_cancel_selection(void)
> +{
> +	cancel_work_sync(&speakup_sel_work.work);
> +	tty_kref_put(speakup_sel_work.tty);
> +	/* setting to null so that if work fails to run and we cancel it,
> +	 * we can run it again without getting EBUSY forever from there on.
> +	 */
> +	speakup_sel_work.tty = NULL;

Thinking again about it, you can not just put the kref on the tty, you
need to know whether the work happened (thus already put the kref) or
not (thus hasn't put the kref).

So instead of just setting tty to NULL, you should xchg it with NULL,
and if it wasn't NULL (the work didn't happen), put the kref.

Samuel
_______________________________________________
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