From bacd1e0ae2f090b5fb7f4fafd496161e691ba27b Mon Sep 17 00:00:00 2001 From: Yong Ding Date: Wed, 4 Jul 2018 15:05:37 +0800 Subject: [PATCH] soc: qcom: hab: check the buffer's pointer before exporting it When the buffer's pointer is NULL, -EINVAL will be returned for its export. Change-Id: I3fc949c6152974db360dc55d3dfdb0cb24150473 Signed-off-by: Yong Ding --- drivers/soc/qcom/hab/hab_mimex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/hab/hab_mimex.c b/drivers/soc/qcom/hab/hab_mimex.c index 86d763f65657..dddf51a80373 100644 --- a/drivers/soc/qcom/hab/hab_mimex.c +++ b/drivers/soc/qcom/hab/hab_mimex.c @@ -240,7 +240,7 @@ int hab_mem_export(struct uhab_context *ctx, int page_count; int compressed = 0; - if (!ctx || !param) + if (!ctx || !param || !param->buffer) return -EINVAL; vchan = hab_get_vchan_fromvcid(param->vcid, ctx); -- 2.11.0