From 630179b7f7d147ee0f7d396e71775b60a16f46a1 Mon Sep 17 00:00:00 2001 From: Xie Yongji Date: Wed, 6 Jul 2022 17:56:24 +0800 Subject: libvduse: Pass positive value to strerror() The value passed to strerror() should be positive. So let's fix it. Fixes: Coverity CID 1490226, 1490223 Signed-off-by: Xie Yongji Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster Message-Id: <20220706095624.328-4-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf --- subprojects/libvduse/libvduse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'subprojects') diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c index 1e36227388..1a5981445c 100644 --- a/subprojects/libvduse/libvduse.c +++ b/subprojects/libvduse/libvduse.c @@ -1257,7 +1257,7 @@ VduseDev *vduse_dev_create_by_name(const char *name, uint16_t num_queues, ret = vduse_dev_init(dev, name, num_queues, ops, priv); if (ret < 0) { fprintf(stderr, "Failed to init vduse device %s: %s\n", - name, strerror(ret)); + name, strerror(-ret)); free(dev); return NULL; } @@ -1331,7 +1331,7 @@ VduseDev *vduse_dev_create(const char *name, uint32_t device_id, ret = vduse_dev_init(dev, name, num_queues, ops, priv); if (ret < 0) { fprintf(stderr, "Failed to init vduse device %s: %s\n", - name, strerror(ret)); + name, strerror(-ret)); goto err; } -- cgit v1.2.3-55-g7522