msm_perf: fix warnings to enable msm_perf

Handle error checks in reading attributes.

Change-Id: I12b693e469b8a8de21a2bef36c92a012e5a2c034
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <quic_bsrivenk@quicinc.com>
This commit is contained in:
Kishore Sri venkata Ganesh Bolisetty 2022-01-25 17:56:19 -08:00 committed by Gerrit - the friendly Code Review server
parent 8a22567035
commit 62a38c3321

View File

@ -977,7 +977,13 @@ static ssize_t set_game_start_pid(struct kobject *kobj,
struct kobj_attribute *attr, const char *buf, size_t count)
{
long usr_val = 0;
kstrtol(buf, 0, &usr_val);
int ret;
ret = kstrtol(buf, 0, &usr_val);
if (ret) {
pr_err("msm_perf: kstrtol failed, ret=%d\n", ret);
return ret;
}
atomic_set(&game_status_pid, usr_val);
return count;
}