.type = TYPE82_RSP_CODE,
                .reply_code = REP82_ERROR_MACHINE_FAILURE,
        };
-       struct type80_hdr *t80h = reply->message;
+       struct type80_hdr *t80h;
        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 (t80h->type == TYPE80_RSP_CODE) {
+               goto out;
+       }
+       t80h = reply->message;
+       if (t80h->type == TYPE80_RSP_CODE) {
                length = min(CEX2A_MAX_RESPONSE_SIZE, (int) t80h->len);
                memcpy(msg->message, reply->message, length);
        } else
                memcpy(msg->message, reply->message, sizeof error_reply);
+out:
        complete((struct completion *) msg->private);
 }
 
 
                .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);
 }
 
 
                .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);
 }
 
 
        };
        struct response_type *resp_type =
                (struct response_type *) msg->private;
-       struct type86x_reply *t86r = reply->message;
+       struct type86x_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->cprbx.cprb_ver_id == 0x02) {
                switch (resp_type->type) {
                case PCIXCC_RESPONSE_TYPE_ICA:
                }
        } else
                memcpy(msg->message, reply->message, sizeof error_reply);
+out:
        complete(&(resp_type->work));
 }