Skip to content

Commit

Permalink
blk-iocost: check return value of match_u64()
Browse files Browse the repository at this point in the history
This patch fixs that the return value of match_u64() from ioc_qos_write()
is not checked,

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230117070806.3857142-2-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Yu Kuai authored and Jens Axboe committed Jan 29, 2023
1 parent 5f2779d commit 7b7c5ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/blk-iocost.c
Original file line number Diff line number Diff line change
Expand Up @@ -3214,7 +3214,8 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input,

switch (match_token(p, qos_ctrl_tokens, args)) {
case QOS_ENABLE:
match_u64(&args[0], &v);
if (match_u64(&args[0], &v))
goto einval;
enable = v;
continue;
case QOS_CTRL:
Expand Down

0 comments on commit 7b7c5ae

Please sign in to comment.