From: Dan Carpenter Date: Fri, 8 May 2015 09:16:25 +0000 (+0300) Subject: virtio_console: silence a static checker warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db1700685c0ad2ecb9e42af6a568435a03bbc3fd;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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 Reviewed-by: Amit Shah Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 50754d203310..d2406fe25533 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1492,8 +1492,8 @@ static int add_port(struct ports_device *portdev, u32 id) * Finally, create the debugfs file that we can use to * inspect a port's state at any time */ - sprintf(debugfs_name, "vport%up%u", - port->portdev->vdev->index, id); + snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u", + port->portdev->vdev->index, id); port->debugfs_file = debugfs_create_file(debugfs_name, 0444, pdrvdata.debugfs_dir, port,