]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 9 Sep 2021 09:14:40 +0000 (12:14 +0300)
committerChristoph Hellwig <hch@lst.de>
Mon, 13 Sep 2021 15:04:03 +0000 (17:04 +0200)
commit12560a3afc6317dea41e0b28ef6f20221a5359f2
tree01e838e1b3ef5deabfa6bc3ad037cdd6586020d5
parent5407b49a7377079a27a8d7fcc8dad2ea3ce157e1
nvmet: fix a width vs precision bug in nvmet_subsys_attr_serial_show()

This was intended to limit the number of characters printed from
"subsys->serial" to NVMET_SN_MAX_SIZE.  But accidentally the width
specifier was used instead of the precision specifier so it only
affects the alignment and not the number of characters printed.

Fixes: b16b565b638e ("nvmet: fixup buffer overrun in nvmet_subsys_attr_serial()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/configfs.c