Skip to content

Commit b6662e3

Browse files
rafaelmsoaresfrankjaa
authored andcommitted
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: 98b1d33 ("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]>
1 parent 6973091 commit b6662e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/kvm/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ int kvm_s390_pci_aen_init(u8 nisc)
126126
return -EPERM;
127127

128128
mutex_lock(&aift->aift_lock);
129-
aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev),
129+
aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev *),
130130
GFP_KERNEL);
131131
if (!aift->kzdev) {
132132
rc = -ENOMEM;

0 commit comments

Comments
 (0)