diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-19 19:10:35 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-19 19:10:34 -0800 |
| commit | 9c52d1de73088b81ea287d05ab7b4092f3354dcc (patch) | |
| tree | 0e5bce6486aeb5de7da3fa5ac8a54b29f46d2211 | |
| parent | e3ab542833e292362bd7fc27282aa4683c4e2184 (diff) | |
| parent | 81b13dfb6863271cbce496a231f28743afea7ff9 (diff) | |
Merge "soc: qcom: smem: Fix possible use of uninitialized variable"
| -rw-r--r-- | drivers/soc/qcom/msm_smem.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/soc/qcom/msm_smem.c b/drivers/soc/qcom/msm_smem.c index 9c4d89ac704d..d3f44ab75f67 100644 --- a/drivers/soc/qcom/msm_smem.c +++ b/drivers/soc/qcom/msm_smem.c @@ -1222,12 +1222,18 @@ static void smem_init_security_partition(struct smem_toc_entry *entry, LOG_ERR("Smem partition %d cached heap exceeds size\n", num); BUG(); } - if (hdr->host0 == SMEM_COMM_HOST && hdr->host1 == SMEM_COMM_HOST) { - comm_partition.partition_num = num; - comm_partition.offset = entry->offset; - comm_partition.size_cacheline = entry->size_cacheline; - SMEM_INFO("Common Partition %d offset:%x\n", num, - entry->offset); + if (is_comm_partition) { + if (hdr->host0 == SMEM_COMM_HOST + && hdr->host1 == SMEM_COMM_HOST) { + comm_partition.partition_num = num; + comm_partition.offset = entry->offset; + comm_partition.size_cacheline = entry->size_cacheline; + SMEM_INFO("Common Partition %d offset:%x\n", num, + entry->offset); + } else { + LOG_ERR("Smem Comm partition hosts don't match TOC\n"); + WARN_ON(1); + } return; } if (hdr->host0 != SMEM_APPS && hdr->host1 != SMEM_APPS) { |
