diff mbox series

[v2] backends/cryptodev-vhost-user: Fix local_error leaks

Message ID DM8PR13MB50781054A4FDACE6F4FB6469B30F2@DM8PR13MB5078.namprd13.prod.outlook.com (mailing list archive)
State New
Headers show
Series [v2] backends/cryptodev-vhost-user: Fix local_error leaks | expand

Commit Message

Gabriel Barrantes Dec. 28, 2024, 1:16 a.m. UTC
From 532af9eecee4695abb02b40f2c18b711370aa7d2 Mon Sep 17 00:00:00 2001
From: Gabriel Barrantes <gabriel.barrantes.dev@outlook.com>
Date: Fri, 27 Dec 2024 18:02:32 -0600
Subject: [PATCH v2] backends/cryptodev-vhost-user: Fix local_error leaks

Do not propagate error to the upper, directly output the error to
avoid leaks.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2714
Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode")

Signed-off-by: Gabriel Barrantes <gabriel.barrantes.dev@outlook.com>
---
Changes in v2:

  *
Add full link to issue.
  *
Add reference to first bad commit.

---
backends/cryptodev-vhost-user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--
2.34.1
diff mbox series

Patch

diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.
c
index 43efdf9747..f87172b330 100644
--- a/backends/cryptodev-vhost-user.c
+++ b/backends/cryptodev-vhost-user.c
@@ -281,8 +281,8 @@  static int cryptodev_vhost_user_create_session(
        break;

    default:
-        error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
-                   sess_info->op_code);
+        error_report("Unsupported opcode :%" PRIu32 "",
+                     sess_info->op_code);
        return -VIRTIO_CRYPTO_NOTSUPP;
    }