OSDN Git Service

soc: qcom: hab: check the buffer's pointer before exporting it
authorYong Ding <yongding@codeaurora.org>
Wed, 4 Jul 2018 07:05:37 +0000 (15:05 +0800)
committerYong Ding <yongding@codeaurora.org>
Wed, 4 Jul 2018 07:08:24 +0000 (15:08 +0800)
When the buffer's pointer is NULL, -EINVAL will be returned for
its export.

Change-Id: I3fc949c6152974db360dc55d3dfdb0cb24150473
Signed-off-by: Yong Ding <yongding@codeaurora.org>
drivers/soc/qcom/hab/hab_mimex.c

index 86d763f..dddf51a 100644 (file)
@@ -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);