diff options
| -rw-r--r-- | drivers/firmware/efi/test/efi_test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index 08129b7b80ab..41c48a1e8baa 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c | |||
| @@ -593,6 +593,9 @@ static long efi_runtime_query_capsulecaps(unsigned long arg) | |||
| 593 | if (copy_from_user(&qcaps, qcaps_user, sizeof(qcaps))) | 593 | if (copy_from_user(&qcaps, qcaps_user, sizeof(qcaps))) |
| 594 | return -EFAULT; | 594 | return -EFAULT; |
| 595 | 595 | ||
| 596 | if (qcaps.capsule_count == ULONG_MAX) | ||
| 597 | return -EINVAL; | ||
| 598 | |||
| 596 | capsules = kcalloc(qcaps.capsule_count + 1, | 599 | capsules = kcalloc(qcaps.capsule_count + 1, |
| 597 | sizeof(efi_capsule_header_t), GFP_KERNEL); | 600 | sizeof(efi_capsule_header_t), GFP_KERNEL); |
| 598 | if (!capsules) | 601 | if (!capsules) |
