summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-01-17 08:08:02 +0100
committerJens Axboe <axboe@kernel.dk>2023-01-29 23:18:34 +0100
commit7b7c5ae4402f810612e84c4ded7a302a61eeba59 (patch)
tree1741f20b6808f7a6a95cd0c8fb813fce3fb12084 /block
parentblk-iocost: avoid 64-bit division in ioc_timer_fn (diff)
downloadlinux-7b7c5ae4402f810612e84c4ded7a302a61eeba59.tar.xz
linux-7b7c5ae4402f810612e84c4ded7a302a61eeba59.zip
blk-iocost: check return value of match_u64()
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-iocost.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index b691b6bb498f..3b99c6a7a104 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -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: