[PATCH] crypto/virtio: return proper error in session fail

Rajesh Mudimadugula rmudimadugul at marvell.com
Wed Jan 8 13:14:27 CET 2025


Return relevant error code when crypto session configure
fails.

Signed-off-by: Rajesh Mudimadugula <rmudimadugul at marvell.com>
---
 drivers/crypto/virtio/virtio_cryptodev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 98415af123..ebb53cd483 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -1373,6 +1373,7 @@ virtio_crypto_sym_configure_session(
 		}
 		break;
 	default:
+		ret = -ENOTSUP;
 		VIRTIO_CRYPTO_SESSION_LOG_ERR(
 			"Unsupported operation chain order parameter");
 		goto error_out;
@@ -1380,7 +1381,7 @@ virtio_crypto_sym_configure_session(
 	return 0;
 
 error_out:
-	return -1;
+	return ret;
 }
 
 static void
-- 
2.34.1



More information about the dev mailing list