提交 db170068 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

virtio_console: silence a static checker warning

My static checker complains that this sprintf() can overflow but really
it can't.  Just silence the warning by using snprintf().
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NAmit Shah <amit.shah@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 45c554ec
...@@ -1492,7 +1492,7 @@ static int add_port(struct ports_device *portdev, u32 id) ...@@ -1492,7 +1492,7 @@ static int add_port(struct ports_device *portdev, u32 id)
* Finally, create the debugfs file that we can use to * Finally, create the debugfs file that we can use to
* inspect a port's state at any time * inspect a port's state at any time
*/ */
sprintf(debugfs_name, "vport%up%u", snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u",
port->portdev->vdev->index, id); port->portdev->vdev->index, id);
port->debugfs_file = debugfs_create_file(debugfs_name, 0444, port->debugfs_file = debugfs_create_file(debugfs_name, 0444,
pdrvdata.debugfs_dir, pdrvdata.debugfs_dir,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册