diff options
Diffstat (limited to 'drivers/s390/crypto/zcrypt_pcica.c')
-rw-r--r-- | drivers/s390/crypto/zcrypt_pcica.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/s390/crypto/zcrypt_pcica.c b/drivers/s390/crypto/zcrypt_pcica.c index 12da4815ba8e..17ba81b58c78 100644 --- a/drivers/s390/crypto/zcrypt_pcica.c +++ b/drivers/s390/crypto/zcrypt_pcica.c | |||
@@ -247,17 +247,21 @@ static void zcrypt_pcica_receive(struct ap_device *ap_dev, | |||
247 | .type = TYPE82_RSP_CODE, | 247 | .type = TYPE82_RSP_CODE, |
248 | .reply_code = REP82_ERROR_MACHINE_FAILURE, | 248 | .reply_code = REP82_ERROR_MACHINE_FAILURE, |
249 | }; | 249 | }; |
250 | struct type84_hdr *t84h = reply->message; | 250 | struct type84_hdr *t84h; |
251 | int length; | 251 | int length; |
252 | 252 | ||
253 | /* Copy the reply message to the request message buffer. */ | 253 | /* Copy the reply message to the request message buffer. */ |
254 | if (IS_ERR(reply)) | 254 | if (IS_ERR(reply)) { |
255 | memcpy(msg->message, &error_reply, sizeof(error_reply)); | 255 | memcpy(msg->message, &error_reply, sizeof(error_reply)); |
256 | else if (t84h->code == TYPE84_RSP_CODE) { | 256 | goto out; |
257 | } | ||
258 | t84h = reply->message; | ||
259 | if (t84h->code == TYPE84_RSP_CODE) { | ||
257 | length = min(PCICA_MAX_RESPONSE_SIZE, (int) t84h->len); | 260 | length = min(PCICA_MAX_RESPONSE_SIZE, (int) t84h->len); |
258 | memcpy(msg->message, reply->message, length); | 261 | memcpy(msg->message, reply->message, length); |
259 | } else | 262 | } else |
260 | memcpy(msg->message, reply->message, sizeof error_reply); | 263 | memcpy(msg->message, reply->message, sizeof error_reply); |
264 | out: | ||
261 | complete((struct completion *) msg->private); | 265 | complete((struct completion *) msg->private); |
262 | } | 266 | } |
263 | 267 | ||