mirror of https://gitee.com/openkylin/linux.git
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: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
45c554ece9
commit
db1700685c
|
@ -1492,8 +1492,8 @@ 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,
|
||||||
port,
|
port,
|
||||||
|
|
Loading…
Reference in New Issue