mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
KVM: arm/arm64: vgic-its: Check result of allocation before use
commit686f294f2fupstream. We miss a test against NULL after allocation. Fixes:6d03a68f80("KVM: arm64: vgic-its: Turn device_id validation into generic ID validation") Reported-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c6c0913bd1
commit
fdbc5f3c5e
@@ -775,6 +775,8 @@ static int vgic_its_alloc_collection(struct vgic_its *its,
|
||||
return E_ITS_MAPC_COLLECTION_OOR;
|
||||
|
||||
collection = kzalloc(sizeof(*collection), GFP_KERNEL);
|
||||
if (!collection)
|
||||
return -ENOMEM;
|
||||
|
||||
collection->collection_id = coll_id;
|
||||
collection->target_addr = COLLECTION_NOT_MAPPED;
|
||||
|
||||
Reference in New Issue
Block a user