if (unlikely(ffs->state == FFS_CLOSING))
return -EBUSY;
+ smp_mb__before_atomic();
if (atomic_read(&ffs->opened))
return -EBUSY;
{
ENTER();
+ smp_mb__before_atomic();
atomic_inc(&ffs->ref);
}
{
ENTER();
+ smp_mb__before_atomic();
atomic_inc(&ffs->ref);
atomic_inc(&ffs->opened);
}
{
ENTER();
+ smp_mb__before_atomic();
if (unlikely(atomic_dec_and_test(&ffs->ref))) {
pr_info("%s(): freeing\n", __func__);
ffs_data_clear(ffs);
{
ENTER();
+ smp_mb__before_atomic();
if (atomic_dec_and_test(&ffs->opened)) {
ffs->state = FFS_CLOSING;
ffs_data_reset(ffs);
/* Dump ffs->gadget and ffs->flags */
if (ffs->gadget)
- pr_err("%s: ffs->gadget= %p, ffs->flags= %lu\n", __func__,
- ffs->gadget, ffs->flags);
+ pr_err("%s: ffs:%p ffs->gadget= %p, ffs->flags= %lu\n",
+ __func__, ffs, ffs->gadget, ffs->flags);
BUG_ON(ffs->gadget);
if (ffs->epfiles)