From: Alexey Khoroshilov Date: Mon, 5 Nov 2012 08:11:41 +0000 (+0900) Subject: extcon: arizona: unlock mutex on error path in arizona_micdet() X-Git-Tag: firefly_0821_release~3680^2~1436^2^2~11 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=be31cc0bc9e6d24d7bd069a4eae81aa9fcf5d2cd;p=firefly-linux-kernel-4.4.55.git extcon: arizona: unlock mutex on error path in arizona_micdet() 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 Acked-by: Mark Brown Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham --- diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index cdab9e598297..d876a54a8bd1 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -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; }