conf: fix unchecked return value

Fixes: Coverity: 1465854 Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 999f5140
...@@ -1201,7 +1201,9 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs) ...@@ -1201,7 +1201,9 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
} }
/* Fallback to bind-mounting the device from the host. */ /* Fallback to bind-mounting the device from the host. */
snprintf(hostpath, sizeof(hostpath), "/dev/%s", device->name); ret = snprintf(hostpath, sizeof(hostpath), "/dev/%s", device->name);
if (ret < 0 || (size_t)ret >= sizeof(hostpath))
return ret_errno(EIO);
ret = safe_mount_beneath_at(dev_dir_fd, hostpath, device->name, NULL, MS_BIND, NULL); ret = safe_mount_beneath_at(dev_dir_fd, hostpath, device->name, NULL, MS_BIND, NULL);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment