aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@bytedance.com>2022-07-06 17:56:24 +0800
committerKevin Wolf <kwolf@redhat.com>2022-08-02 11:01:42 +0200
commit630179b7f7d147ee0f7d396e71775b60a16f46a1 (patch)
treed131b1cbacc792bd986cef03930dc570b10851df
parentd9cf16c0bee5b97fb76e0e1ad915a22bec0031b9 (diff)
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 <xieyongji@bytedance.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220706095624.328-4-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--subprojects/libvduse/libvduse.c4
1 files changed, 2 insertions, 2 deletions
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;
}