|
@@ -447,19 +447,23 @@ static void zcrypt_pcicc_receive(struct ap_device *ap_dev,
|
|
.type = TYPE82_RSP_CODE,
|
|
.type = TYPE82_RSP_CODE,
|
|
.reply_code = REP82_ERROR_MACHINE_FAILURE,
|
|
.reply_code = REP82_ERROR_MACHINE_FAILURE,
|
|
};
|
|
};
|
|
- struct type86_reply *t86r = reply->message;
|
|
|
|
|
|
+ struct type86_reply *t86r;
|
|
int length;
|
|
int length;
|
|
|
|
|
|
/* Copy the reply message to the request message buffer. */
|
|
/* 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));
|
|
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) {
|
|
t86r->cprb.cprb_ver_id == 0x01) {
|
|
length = sizeof(struct type86_reply) + t86r->length - 2;
|
|
length = sizeof(struct type86_reply) + t86r->length - 2;
|
|
length = min(PCICC_MAX_RESPONSE_SIZE, length);
|
|
length = min(PCICC_MAX_RESPONSE_SIZE, length);
|
|
memcpy(msg->message, reply->message, length);
|
|
memcpy(msg->message, reply->message, length);
|
|
} else
|
|
} else
|
|
memcpy(msg->message, reply->message, sizeof error_reply);
|
|
memcpy(msg->message, reply->message, sizeof error_reply);
|
|
|
|
+out:
|
|
complete((struct completion *) msg->private);
|
|
complete((struct completion *) msg->private);
|
|
}
|
|
}
|
|
|
|
|