aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Mendonca <[email protected]>2022-10-25 22:32:33 -0300
committerJanosch Frank <[email protected]>2022-11-07 10:14:15 +0100
commitb6662e37772715447aeff2538444ff291e02ea31 (patch)
tree509ef340e537d0d4422f42d56b5619e6a11df7eb
parent6973091d1b50ab4042f6a2d495f59e9db3662ab8 (diff)
KVM: s390: pci: Fix allocation size of aift kzdev elements
The 'kzdev' field of struct 'zpci_aift' is an array of pointers to 'kvm_zdev' structs. Allocate the proper size accordingly. Reported by Coccinelle: WARNING: Use correct pointer type argument for sizeof Fixes: 98b1d33dac5f ("KVM: s390: pci: do initial setup for AEN interpretation") Signed-off-by: Rafael Mendonca <[email protected]> Reviewed-by: Christian Borntraeger <[email protected]> Reviewed-by: Matthew Rosato <[email protected]> Link: https://lore.kernel.org/r/[email protected] Message-Id: <[email protected]> Signed-off-by: Janosch Frank <[email protected]>
-rw-r--r--arch/s390/kvm/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c
index c50c1645c0ae..ded1af2ddae9 100644
--- a/arch/s390/kvm/pci.c
+++ b/arch/s390/kvm/pci.c
@@ -126,7 +126,7 @@ int kvm_s390_pci_aen_init(u8 nisc)
return -EPERM;
mutex_lock(&aift->aift_lock);
- aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev),
+ aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev *),
GFP_KERNEL);
if (!aift->kzdev) {
rc = -ENOMEM;