public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] PM / devfreq: Fix missing unlock on error in devfreq_add_device()
@ 2020-07-14  6:30 Wei Yongjun
  2020-07-14  9:37 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2020-07-14  6:30 UTC (permalink / raw)
  To: MyungJoo Ham, Kyungmin Park, Chanwoo Choi
  Cc: Wei Yongjun, linux-pm, kernel-janitors, Hulk Robot

Add the missing unlock before return from function devfreq_add_device()
in the error handling case.

Fixes: d7c46505a7ad ("PM / devfreq: Add support delayed timer for polling mode")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/devfreq/devfreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 5320c3b37f35..2b54a59bb281 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -788,6 +788,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
 
 	if (devfreq->profile->timer < 0
 		|| devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
+		mutex_unlock(&devfreq->lock);
 		goto err_out;
 	}




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-14 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-14  6:30 [PATCH -next] PM / devfreq: Fix missing unlock on error in devfreq_add_device() Wei Yongjun
2020-07-14  9:37 ` Dan Carpenter
2020-07-14 10:59   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox