Skip to content

Commit

Permalink
NFC: trf7970a: Unlock mutex before exiting trf7970a_irq()
Browse files Browse the repository at this point in the history
Recent changes to trf7970a_irq() added a couple return
paths that don't unlock the mutex that is locked when
the routine is entered.  Fix this by ensuring the mutex
is always unlocked before returning.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Mark A. Greer authored and Samuel Ortiz committed Sep 23, 2014
1 parent 55ef2e7 commit b9e3016
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/nfc/trf7970a.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id)
TRF7970A_SPECIAL_FCN_REG1,
TRF7970A_SPECIAL_FCN_REG1_14_ANTICOLL);
if (ret)
return ret;
goto err_unlock_exit;

trf->special_fcn_reg1 =
TRF7970A_SPECIAL_FCN_REG1_14_ANTICOLL;
Expand All @@ -933,7 +933,7 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id)
ret = trf7970a_write(trf, TRF7970A_ISO_CTRL,
iso_ctrl);
if (ret)
return ret;
goto err_unlock_exit;

trf->iso_ctrl = iso_ctrl;
}
Expand Down Expand Up @@ -975,6 +975,7 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id)
__func__, trf->state);
}

err_unlock_exit:
mutex_unlock(&trf->lock);
return IRQ_HANDLED;
}
Expand Down

0 comments on commit b9e3016

Please sign in to comment.