On Wed, 5 Jun 2019 at 16:04, Marc-André Lureau <marcandre.lur...@redhat.com> wrote: > > This should fix coverity CID 1401704. > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > contrib/vhost-user-input/main.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c > index 54f882602a..8b4e7d2536 100644 > --- a/contrib/vhost-user-input/main.c > +++ b/contrib/vhost-user-input/main.c > @@ -342,7 +342,11 @@ main(int argc, char *argv[]) > > vi.config = g_array_new(false, false, sizeof(virtio_input_config)); > memset(&id, 0, sizeof(id)); > - ioctl(vi.evdevfd, EVIOCGNAME(sizeof(id.u.string) - 1), id.u.string); > + if (ioctl(vi.evdevfd, EVIOCGNAME(sizeof(id.u.string) - 1), > + id.u.string) < 0) { > + g_printerr("Failed to get evdev name: %s\n", g_strerror(errno)); > + exit(EXIT_FAILURE); > + }
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM