From d1e024176c87a67967f6f420011d4067fe2a0944 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 13 Oct 2021 13:08:59 +0000 Subject: The kernel crypto framework sometimes returned an error, sometimes the callback was called, and sometimes both. So the caller of that API could not release resources correctly. A bunch of errors can or should not happen, replace them with an assert. Remove redundant checks. crypto_invoke() should not return the error, but pass it via callback. Some old hardware drivers keep part of their inconsistency as I cannot test them. OK mpi@ --- sys/arch/octeon/dev/octcrypto.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/arch/octeon') diff --git a/sys/arch/octeon/dev/octcrypto.c b/sys/arch/octeon/dev/octcrypto.c index abfa258dce2..26449679790 100644 --- a/sys/arch/octeon/dev/octcrypto.c +++ b/sys/arch/octeon/dev/octcrypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octcrypto.c,v 1.5 2021/07/08 09:22:30 bluhm Exp $ */ +/* $OpenBSD: octcrypto.c,v 1.6 2021/10/13 13:08:58 bluhm Exp $ */ /* * Copyright (c) 2018 Visa Hankala @@ -597,9 +597,6 @@ octcrypto_process(struct cryptop *crp) int error = 0; int i; - if (crp == NULL || crp->crp_callback == NULL) - return EINVAL; - KASSERT(crp->crp_ndesc >= 1); smr_read_enter(); -- cgit v1.2.3