diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index e2ab46bfa666e4e5f39a7114ba3ae40e352d8ae6..d350253d161a56283e0a1d5306e760a404943d2c 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -257,7 +257,7 @@ static struct devfreq_governor *try_then_request_governor(const char *name) /* Restore previous state before return */ mutex_lock(&devfreq_list_lock); if (err) - return ERR_PTR(err); + return (err < 0) ? ERR_PTR(err) : ERR_PTR(-EINVAL); governor = find_devfreq_governor(name); }