mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 19:21:28 +02:00
msm_perf: Handle out of bounds case
KASAN seems to be flagging that bool would only be 1 byte while %du would want to write 4 bytes leading to out of bounds. Change-Id: I0e43b1103b882bbd61b5a0bef231efcc3d7d1e1b Signed-off-by: Badri Sampath <quic_badris@quicinc.com>
This commit is contained in:
parent
8a22567035
commit
d6a47b123a
|
|
@ -927,7 +927,7 @@ static ssize_t set_core_ctl_register(struct kobject *kobj,
|
|||
bool old_val = core_ctl_register;
|
||||
int ret;
|
||||
|
||||
ret = sscanf(buf, "%du", &core_ctl_register);
|
||||
ret = kstrtobool(buf, &core_ctl_register);
|
||||
if (ret < 0) {
|
||||
pr_err("msm_perf: getting new core_ctl_register failed, ret=%d\n", ret);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user