All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [PULL 4/7] libvduse: Pass positive value to strerror()
Date: Tue,  2 Aug 2022 15:37:54 +0200	[thread overview]
Message-ID: <20220802133757.138016-5-kwolf@redhat.com> (raw)
In-Reply-To: <20220802133757.138016-1-kwolf@redhat.com>

From: Xie Yongji <xieyongji@bytedance.com>

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>
---
 subprojects/libvduse/libvduse.c | 4 ++--
 1 file 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;
     }
 
-- 
2.35.3



  parent reply	other threads:[~2022-08-02 13:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 13:37 [PULL 0/7] Block layer patches Kevin Wolf
2022-08-02 13:37 ` [PULL 1/7] block/io_uring: add missing include file Kevin Wolf
2022-08-02 13:37 ` [PULL 2/7] libvduse: Fix the incorrect function name Kevin Wolf
2022-08-02 13:37 ` [PULL 3/7] libvduse: Replace strcpy() with strncpy() Kevin Wolf
2022-08-02 13:37 ` Kevin Wolf [this message]
2022-08-02 13:37 ` [PULL 5/7] hw/block/hd-geometry: Do not override specified bios-chs-trans Kevin Wolf
2022-08-02 13:37 ` [PULL 6/7] qemu-iotests: Discard stderr when probing devices Kevin Wolf
2022-08-02 13:37 ` [PULL 7/7] main loop: add missing documentation links to GS/IO macros Kevin Wolf
2022-08-02 15:34 ` [PULL 0/7] Block layer patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220802133757.138016-5-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.