PM / devfreq: Add missing error code in devfreq_add_device()
[ Upstream commit 18b380ed61f892ed06838d1f1a5124d966292ed3 ]
Set err code in the error path before jumping to the end of the function.
Fixes: 4dc3bab868
("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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
a61f8a2e45
commit
4dcb59d6a2
@@ -789,6 +789,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||||||
if (devfreq->profile->timer < 0
|
if (devfreq->profile->timer < 0
|
||||||
|| devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
|
|| devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
|
||||||
mutex_unlock(&devfreq->lock);
|
mutex_unlock(&devfreq->lock);
|
||||||
|
err = -EINVAL;
|
||||||
goto err_dev;
|
goto err_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user