From 12f9041489058d605dc7fae2923d38eeb707b5d1 Mon Sep 17 00:00:00 2001 From: Zhen Kong Date: Wed, 7 Sep 2016 16:22:11 +0530 Subject: [PATCH] qseecom: Change whitelist_support flag to false if TZ failed to check The whitelist status is set default as true though TZ failed to check, which in turn causing the send_command fail by passing whitelist commnd id. So updating the support status flag to false when TZ fails to check. Change-Id: I78a7600506b4d2457bb1c38f8a39888a9cf9467c Signed-off-by: Mallikarjuna Reddy Amireddy Signed-off-by: Zhen Kong --- drivers/misc/qseecom.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c index bd554667de96..644178a0cdfc 100644 --- a/drivers/misc/qseecom.c +++ b/drivers/misc/qseecom.c @@ -7146,8 +7146,10 @@ static int qseecom_open(struct inode *inode, struct file *file) atomic_set(&data->ioctl_count, 0); data->sglistinfo_ptr = kzalloc(SGLISTINFO_TABLE_SIZE, GFP_KERNEL); - if (!(data->sglistinfo_ptr)) + if (!(data->sglistinfo_ptr)) { + kzfree(data); return -ENOMEM; + } return ret; } @@ -8011,8 +8013,10 @@ static int qseecom_check_whitelist_feature(void) qseecom.whitelist_support = true; ret = 0; } else { - pr_err("Failed to check whitelist: ret = %d, result = 0x%x\n", + pr_info("Check whitelist with ret = %d, result = 0x%x\n", ret, resp.result); + qseecom.whitelist_support = false; + ret = 0; } kfree(buf); return ret;