mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
blk-mq: make sure that line break can be printed
8962842ca5
("blk-mq: avoid sysfs buffer overflow with too many CPU cores") avoids sysfs buffer overflow, and reserves one character for line break. However, the last snprintf() doesn't get correct 'size' parameter passed in, so fixed it. Fixes:8962842ca5
("blk-mq: avoid sysfs buffer overflow with too many CPU cores") Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
62c441c6ae
commit
d2c9be89f8
@ -175,7 +175,7 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
|
||||
pos += ret;
|
||||
}
|
||||
|
||||
ret = snprintf(pos + page, size - pos, "\n");
|
||||
ret = snprintf(pos + page, size + 1 - pos, "\n");
|
||||
return pos + ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user