crypto/virtio: return proper error in session fail

Message ID 20250108121427.3715-1-rmudimadugul@marvell.com (mailing list archive)
State Accepted
Delegated to: akhil goyal
Headers
Series crypto/virtio: return proper error in session fail |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Rajesh Mudimadugula Jan. 8, 2025, 12:14 p.m. UTC
Return relevant error code when crypto session configure
fails.

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

Comments

Akhil Goyal Feb. 6, 2025, 12:37 p.m. UTC | #1
> Return relevant error code when crypto session configure
> fails.
> 
> Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto
Thanks.
  

Patch

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