diff options
author | Holger Dengler <hd@linux.vnet.ibm.com> | 2011-12-27 05:27:20 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-12-27 05:27:13 -0500 |
commit | 2389aef47efe32bd4ad2b7d47f157766d3680caa (patch) | |
tree | 3e80bd8d2f1682c9e726d1bdb204f3d0fc020b23 /drivers/s390/crypto | |
parent | 7fe6f0970cf87dfd71452f5ec7ea54654acc9d6f (diff) |
[S390] zcrypt: Fix error return codes.
Return EINVAL instead of EFAULT for invalid input parameter.
Signed-off-by: Holger Dengler <hd@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto')
-rw-r--r-- | drivers/s390/crypto/zcrypt_pcixcc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c index 646fb8f11512..077b7d109fde 100644 --- a/drivers/s390/crypto/zcrypt_pcixcc.c +++ b/drivers/s390/crypto/zcrypt_pcixcc.c | |||
@@ -260,7 +260,7 @@ static int ICACRT_msg_to_type6CRT_msgX(struct zcrypt_device *zdev, | |||
260 | * @ap_msg: pointer to AP message | 260 | * @ap_msg: pointer to AP message |
261 | * @xcRB: pointer to user input data | 261 | * @xcRB: pointer to user input data |
262 | * | 262 | * |
263 | * Returns 0 on success or -EFAULT. | 263 | * Returns 0 on success or -EFAULT, -EINVAL. |
264 | */ | 264 | */ |
265 | struct type86_fmt2_msg { | 265 | struct type86_fmt2_msg { |
266 | struct type86_hdr hdr; | 266 | struct type86_hdr hdr; |
@@ -290,12 +290,12 @@ static int XCRB_msg_to_type6CPRB_msgX(struct zcrypt_device *zdev, | |||
290 | CEIL4(xcRB->request_control_blk_length) + | 290 | CEIL4(xcRB->request_control_blk_length) + |
291 | xcRB->request_data_length; | 291 | xcRB->request_data_length; |
292 | if (ap_msg->length > PCIXCC_MAX_XCRB_MESSAGE_SIZE) | 292 | if (ap_msg->length > PCIXCC_MAX_XCRB_MESSAGE_SIZE) |
293 | return -EFAULT; | 293 | return -EINVAL; |
294 | replylen = sizeof(struct type86_fmt2_msg) + | 294 | replylen = sizeof(struct type86_fmt2_msg) + |
295 | CEIL4(xcRB->reply_control_blk_length) + | 295 | CEIL4(xcRB->reply_control_blk_length) + |
296 | xcRB->reply_data_length; | 296 | xcRB->reply_data_length; |
297 | if (replylen > PCIXCC_MAX_XCRB_MESSAGE_SIZE) | 297 | if (replylen > PCIXCC_MAX_XCRB_MESSAGE_SIZE) |
298 | return -EFAULT; | 298 | return -EINVAL; |
299 | 299 | ||
300 | /* prepare type6 header */ | 300 | /* prepare type6 header */ |
301 | msg->hdr = static_type6_hdrX; | 301 | msg->hdr = static_type6_hdrX; |
@@ -314,7 +314,7 @@ static int XCRB_msg_to_type6CPRB_msgX(struct zcrypt_device *zdev, | |||
314 | return -EFAULT; | 314 | return -EFAULT; |
315 | if (msg->cprbx.cprb_len + sizeof(msg->hdr.function_code) > | 315 | if (msg->cprbx.cprb_len + sizeof(msg->hdr.function_code) > |
316 | xcRB->request_control_blk_length) | 316 | xcRB->request_control_blk_length) |
317 | return -EFAULT; | 317 | return -EINVAL; |
318 | function_code = ((unsigned char *)&msg->cprbx) + msg->cprbx.cprb_len; | 318 | function_code = ((unsigned char *)&msg->cprbx) + msg->cprbx.cprb_len; |
319 | memcpy(msg->hdr.function_code, function_code, sizeof(msg->hdr.function_code)); | 319 | memcpy(msg->hdr.function_code, function_code, sizeof(msg->hdr.function_code)); |
320 | 320 | ||