clear-pkgs-linux-iot-lts2018/1065-fix-possible-nulll-poi...

32 lines
1.0 KiB
Diff
Raw Permalink Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yonghua Huang <yonghua.huang@intel.com>
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 <yonghua.huang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
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
2020-10-27 02:14:06 +08:00
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