diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index 19efe5f157763cb4fd3c4250e61f66fbe3dc7dc4..5006a0d0099010413fbffb2a644e5c8b7a93d36f 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c @@ -168,7 +168,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; }