extcon: arizona: unlock mutex on error path in arizona_micdet()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Mon, 5 Nov 2012 08:11:41 +0000 (17:11 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 20 Nov 2012 07:00:44 +0000 (16:00 +0900)
If regmap_read() failed, arizona_micdet() returns IRQ_NONE
leaving &info->lock mutex locked as opposed to all other return paths.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
drivers/extcon/extcon-arizona.c

index cdab9e598297b8102fcb18df0984e26b49140685..d876a54a8bd11b4671a6baf0b8be89f4e50f7129 100644 (file)
@@ -166,6 +166,7 @@ static irqreturn_t arizona_micdet(int irq, void *data)
        ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_3, &val);
        if (ret != 0) {
                dev_err(arizona->dev, "Failed to read MICDET: %d\n", ret);
+               mutex_unlock(&info->lock);
                return IRQ_NONE;
        }