Merge branch 'avr32-arch' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoe...
[cascardo/linux.git] / drivers / s390 / crypto / zcrypt_pcicc.c
index 779952c..f4b0c47 100644 (file)
@@ -447,19 +447,23 @@ static void zcrypt_pcicc_receive(struct ap_device *ap_dev,
                .type = TYPE82_RSP_CODE,
                .reply_code = REP82_ERROR_MACHINE_FAILURE,
        };
-       struct type86_reply *t86r = reply->message;
+       struct type86_reply *t86r;
        int length;
 
        /* Copy the reply message to the request message buffer. */
-       if (IS_ERR(reply))
+       if (IS_ERR(reply)) {
                memcpy(msg->message, &error_reply, sizeof(error_reply));
-       else if (t86r->hdr.type == TYPE86_RSP_CODE &&
+               goto out;
+       }
+       t86r = reply->message;
+       if (t86r->hdr.type == TYPE86_RSP_CODE &&
                 t86r->cprb.cprb_ver_id == 0x01) {
                length = sizeof(struct type86_reply) + t86r->length - 2;
                length = min(PCICC_MAX_RESPONSE_SIZE, length);
                memcpy(msg->message, reply->message, length);
        } else
                memcpy(msg->message, reply->message, sizeof error_reply);
+out:
        complete((struct completion *) msg->private);
 }