]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PM / devfreq: Add missing error code in devfreq_add_device()
authorYueHaibing <yuehaibing@huawei.com>
Fri, 14 May 2021 06:48:43 +0000 (14:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:59:40 +0000 (16:59 +0200)
[ Upstream commit 18b380ed61f892ed06838d1f1a5124d966292ed3 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/devfreq/devfreq.c

index 59ba59bea0f54a645ff7f07124975f13dfd197a3..db1bc8cf92766af599f5e62d4e96897d4fc6fe98 100644 (file)
@@ -822,6 +822,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;
        }