From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Tue, 23 Apr 2019 01:34:01 +0800 Subject: [PATCH] fix possible nulll pointer dereference in ACRN VHM Null pointer dereference will happen if 'vm' is null in acrn_ioreq_get_reqbuf(). Tracked-On: projectacrn/acrn-hypervisor#1479 Signed-off-by: Yonghua Huang Reviewed-by: Zhao Yakui Tracked-On: PKT-2115 --- drivers/vhm/vhm_ioreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhm/vhm_ioreq.c b/drivers/vhm/vhm_ioreq.c index 3647d1ef1962..9deb720062c8 100644 --- a/drivers/vhm/vhm_ioreq.c +++ b/drivers/vhm/vhm_ioreq.c @@ -547,6 +547,7 @@ struct vhm_request *acrn_ioreq_get_reqbuf(int client_id) if (unlikely(vm == NULL || vm->req_buf == NULL)) { pr_warn("vhm-ioreq: the req buf page not ready yet " "for vmid %ld\n", client->vmid); + return NULL; } acrn_ioreq_put_client(client); return (struct vhm_request *)vm->req_buf; -- https://clearlinux.org