summaryrefslogtreecommitdiff
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-05-14 09:48:43 +0300
committerChanwoo Choi <cw00.choi@samsung.com>2021-05-20 06:16:41 +0300
commit18b380ed61f892ed06838d1f1a5124d966292ed3 (patch)
treec1a110fa09dd0ea22365ae33eadf1570faf17961 /drivers/devfreq/devfreq.c
parentd07f6ca923ea0927a1024dfccafc5b53b61cfecc (diff)
downloadlinux-18b380ed61f892ed06838d1f1a5124d966292ed3.tar.xz
PM / devfreq: Add missing error code in devfreq_add_device()
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> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c1
1 files changed, 1 insertions, 0 deletions
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;
}