Merge branch 'sh/sdhi-mfd'
[linux-2.6-block.git] / drivers / s390 / crypto / zcrypt_pcica.c
index 12da4815ba8eea3ffa8fbdbf773661dbb5650697..17ba81b58c78f473974f7ecfa7c0d714861a6c54 100644 (file)
@@ -247,17 +247,21 @@ static void zcrypt_pcica_receive(struct ap_device *ap_dev,
                .type = TYPE82_RSP_CODE,
                .reply_code = REP82_ERROR_MACHINE_FAILURE,
        };
-       struct type84_hdr *t84h = reply->message;
+       struct type84_hdr *t84h;
        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 (t84h->code == TYPE84_RSP_CODE) {
+               goto out;
+       }
+       t84h = reply->message;
+       if (t84h->code == TYPE84_RSP_CODE) {
                length = min(PCICA_MAX_RESPONSE_SIZE, (int) t84h->len);
                memcpy(msg->message, reply->message, length);
        } else
                memcpy(msg->message, reply->message, sizeof error_reply);
+out:
        complete((struct completion *) msg->private);
 }