s390/pkey: Wipe sensitive data on failure
[linux-2.6-block.git] / drivers / s390 / crypto / pkey_api.c
index 933894065623ed45736b2a1d94d9f43754ff762b..179287157c2fe1e8a2f03eb10ba8e09077f29c5c 100644 (file)
@@ -1377,7 +1377,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
                if (rc)
                        break;
                if (copy_to_user(ucs, &kcs, sizeof(kcs)))
-                       return -EFAULT;
+                       rc = -EFAULT;
                memzero_explicit(&kcs, sizeof(kcs));
                break;
        }
@@ -1412,7 +1412,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
                if (rc)
                        break;
                if (copy_to_user(ucp, &kcp, sizeof(kcp)))
-                       return -EFAULT;
+                       rc = -EFAULT;
                memzero_explicit(&kcp, sizeof(kcp));
                break;
        }