From: Yu Kuai Date: Tue, 17 Jan 2023 07:08:02 +0000 (+0800) Subject: blk-iocost: check return value of match_u64() X-Git-Tag: v6.6.17~5251^2~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b7c5ae4402f810612e84c4ded7a302a61eeba59;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230117070806.3857142-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe --- diff --git a/block/blk-iocost.c b/block/blk-iocost.c index b691b6b..3b99c6a 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: