ANDROID: uid_sys_stats: allow writing same state

Signed-off-by: Jin Qian <jinqian@google.com>
Bug: 34360629
Change-Id: Ia748351e07910b1febe54f0484ca1be58c4eb9c7
This commit is contained in:
Jin Qian 2017-01-17 17:26:07 -08:00 committed by Amit Pundir
parent b66fd44391
commit 396f015c5d

View file

@ -336,11 +336,16 @@ static ssize_t uid_procstat_write(struct file *file,
mutex_lock(&uid_lock);
uid_entry = find_or_register_uid(uid);
if (!uid_entry || uid_entry->state == state) {
if (!uid_entry) {
mutex_unlock(&uid_lock);
return -EINVAL;
}
if (uid_entry->state == state) {
mutex_unlock(&uid_lock);
return count;
}
update_io_stats_locked();
uid_entry->state = state;