Message ID | 76b99c5399941998bf19e51795c404eb@codeaurora.org (mailing list archive) |
---|---|
State | Deferred |
Headers | show |
diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c index 77028c2..a84796d 100644 --- a/drivers/devfreq/governor_userspace.c +++ b/drivers/devfreq/governor_userspace.c @@ -53,12 +53,15 @@ static ssize_t store_freq(struct device *dev, struct device_attribute *attr, mutex_lock(&devfreq->lock); data = devfreq->data; - sscanf(buf, "%lu", &wanted); + err = kstrtol(buf, 0, &wanted); + if (err < 0) + goto out; data->user_frequency = wanted; data->valid = true; err = update_devfreq(devfreq); if (err == 0) err = count; +out: mutex_unlock(&devfreq->lock); return err;