]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
NFC: trf7970a: Unlock mutex before exiting trf7970a_irq()
authorMark A. Greer <mgreer@animalcreek.com>
Tue, 23 Sep 2014 18:25:47 +0000 (11:25 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 23 Sep 2014 22:28:23 +0000 (00:28 +0200)
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>
drivers/nfc/trf7970a.c

index 59a7df7f023cd2eaa8369350fc6fefe98749531f..0fe7b957436c51463f45eec9e565d9f6bf564387 100644 (file)
@@ -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;
@@ -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;
                        }
@@ -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;
 }