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>
[dereference23: Backport to msm-5.4]
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
This commit is contained in:
Kishore Sri venkata Ganesh Bolisetty 2022-01-25 17:56:19 -08:00 committed by Alexander Winkowski
parent 04664d5d69
commit 4e24aaf585
No known key found for this signature in database
GPG key ID: 72762A66704CDE44

View file

@ -913,9 +913,14 @@ void msm_perf_events_update(enum evt_update_t update_typ,
static int set_game_start_pid(const char *buf, const struct kernel_param *kp)
{
long usr_val = 0;
int ret = strlen(buf);
int ret;
kstrtol(buf, 0, &usr_val);
ret = kstrtol(buf, 0, &usr_val);
if (ret) {
pr_err("msm_perf: kstrtol failed, ret=%d\n", ret);
return ret;
}
ret = strlen(buf);
atomic_set(&game_status_pid, usr_val);
return ret;
}