Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/sunxi Make sure ERESTART doesn't come flying ou...



details:   https://anonhg.NetBSD.org/src/rev/bb06a32c58f7
branches:  trunk
changeset: 466024:bb06a32c58f7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Dec 09 14:56:18 2019 +0000

description:
Make sure ERESTART doesn't come flying out to userland.

I picked ERESTART to mean `all channels are occupied' because that's
what opencrypto(9) uses to decide whether to queue a request, but
it's not appropriate for sysctl(2) to return that.

diffstat:

 sys/arch/arm/sunxi/sun8i_crypto.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 3b4a8e506576 -r bb06a32c58f7 sys/arch/arm/sunxi/sun8i_crypto.c
--- a/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 09 14:56:06 2019 +0000
+++ b/sys/arch/arm/sunxi/sun8i_crypto.c Mon Dec 09 14:56:18 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sun8i_crypto.c,v 1.3 2019/12/09 14:56:06 riastradh Exp $       */
+/*     $NetBSD: sun8i_crypto.c,v 1.4 2019/12/09 14:56:18 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.3 2019/12/09 14:56:06 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.4 2019/12/09 14:56:18 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1232,8 +1232,11 @@
 
        /* Submit the TRNG task.  */
        error = sun8i_crypto_submit_trng(sc, req->cu_task, size);
-       if (error)
+       if (error) {
+               if (error == ERESTART)
+                       error = EBUSY;
                goto out2;
+       }
 
        /* Wait for the request to complete.  */
        mutex_enter(&req->cu_lock);



Home | Main Index | Thread Index | Old Index