* [PATCH -next] PM / devfreq: Add missing error code in devfreq_add_device()
@ 2021-05-14 6:48 YueHaibing
0 siblings, 0 replies; only message in thread
From: YueHaibing @ 2021-05-14 6:48 UTC (permalink / raw)
To: myungjoo.ham, kyungmin.park, cw00.choi, b.zolnierkie, lukasz.luba
Cc: linux-pm, linux-kernel, YueHaibing
Set err code in the error path before jumping to the end of the function.
Fixes: 4dc3bab8687f ("PM / devfreq: Add support delayed timer for polling mode")
Signed-off-by: YueHaibing <yuehaibing@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 fe08c46642f7..28f3e0ba6cdd 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -823,6 +823,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
if (devfreq->profile->timer < 0
|| devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
mutex_unlock(&devfreq->lock);
+ err = -EINVAL;
goto err_dev;
}
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-14 6:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 6:48 [PATCH -next] PM / devfreq: Add missing error code in devfreq_add_device() YueHaibing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).