Merge tag 'stream_open-5.2' of https://lab.nexedi.com/kirr/linux
[sfrench/cifs-2.6.git] / drivers / s390 / crypto / zcrypt_api.c
index 689c2af7026a3adcf08e2e6eb019d9352e6de9d4..852b8c2299c1cd10cab61f9e429a4650b337c5c5 100644 (file)
@@ -525,7 +525,7 @@ static int zcrypt_open(struct inode *inode, struct file *filp)
        filp->private_data = (void *) perms;
 
        atomic_inc(&zcrypt_open_count);
-       return nonseekable_open(inode, filp);
+       return stream_open(inode, filp);
 }
 
 /**
@@ -659,6 +659,7 @@ static long zcrypt_rsa_modexpo(struct ap_perms *perms,
        trace_s390_zcrypt_req(mex, TP_ICARSAMODEXPO);
 
        if (mex->outputdatalength < mex->inputdatalength) {
+               func_code = 0;
                rc = -EINVAL;
                goto out;
        }
@@ -742,6 +743,7 @@ static long zcrypt_rsa_crt(struct ap_perms *perms,
        trace_s390_zcrypt_req(crt, TP_ICARSACRT);
 
        if (crt->outputdatalength < crt->inputdatalength) {
+               func_code = 0;
                rc = -EINVAL;
                goto out;
        }
@@ -951,6 +953,7 @@ static long zcrypt_send_ep11_cprb(struct ap_perms *perms,
 
                targets = kcalloc(target_num, sizeof(*targets), GFP_KERNEL);
                if (!targets) {
+                       func_code = 0;
                        rc = -ENOMEM;
                        goto out;
                }
@@ -958,6 +961,7 @@ static long zcrypt_send_ep11_cprb(struct ap_perms *perms,
                uptr = (struct ep11_target_dev __force __user *) xcrb->targets;
                if (copy_from_user(targets, uptr,
                                   target_num * sizeof(*targets))) {
+                       func_code = 0;
                        rc = -EFAULT;
                        goto out_free;
                }