Skip to content

Commit

Permalink
PM / devfreq: Add missing error code in devfreq_add_device()
Browse files Browse the repository at this point in the history
[ Upstream commit 18b380e ]

Set err code in the error path before jumping to the end of the function.

Fixes: 4dc3bab ("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>
  • Loading branch information
YueHaibing authored and gregkh committed Jul 14, 2021
1 parent 72702d8 commit 6e2ad5a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6e2ad5a

Please sign in to comment.