On Tue, 19 Dec 2017 07:42:20 -0800
Xiao Wang <xiao.w.w...@intel.com> wrote:

> +     atomic_dec(&udev->refcnt);
> +     if (atomic_read(&udev->refcnt) > 0)
> +             return 0;
> +

The point of using atomic functions is to do atomic operations.
You need to use atomic_dec_and_test here.

Reply via email to