summaryrefslogtreecommitdiff
path: root/drivers/platform/msm
diff options
context:
space:
mode:
authorGidon Studinski <gidons@codeaurora.org>2016-06-09 15:44:29 +0300
committerKyle Yan <kyan@codeaurora.org>2016-06-16 15:24:50 -0700
commitc13c4916b8cf4256b21b16fe5db306b2fc095945 (patch)
tree40a39b96895dc2c36c3bdcc3e215acb1332b2ce2 /drivers/platform/msm
parentebdfa88580493c9f1259cf25c318548599845ada (diff)
msm: ipa: fix static analysis issues
Fix several static analysis issues in IPA driver. Change-Id: If04e11b9e44aabb7c9389dbf79ed9c80c66c877e Signed-off-by: Gidon Studinski <gidons@codeaurora.org>
Diffstat (limited to 'drivers/platform/msm')
-rw-r--r--drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c7
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_dp.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
index 9336250352f0..50e820992f29 100644
--- a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
@@ -618,6 +618,11 @@ static int wwan_add_ul_flt_rule_to_ipa(void)
struct ipa_flt_rule_add flt_rule_entry;
struct ipa_fltr_installed_notif_req_msg_v01 *req;
+ if (ipa_qmi_ctx == NULL) {
+ IPAWANERR("ipa_qmi_ctx is NULL!\n");
+ return -EFAULT;
+ }
+
pyld_sz = sizeof(struct ipa_ioc_add_flt_rule) +
sizeof(struct ipa_flt_rule_add);
param = kzalloc(pyld_sz, GFP_KERNEL);
@@ -638,7 +643,7 @@ static int wwan_add_ul_flt_rule_to_ipa(void)
param->num_rules = (uint8_t)1;
mutex_lock(&ipa_qmi_lock);
- for (i = 0; i < num_q6_rule && (ipa_qmi_ctx != NULL); i++) {
+ for (i = 0; i < num_q6_rule; i++) {
param->ip = ipa_qmi_ctx->q6_ul_filter_rule[i].ip;
memset(&flt_rule_entry, 0, sizeof(struct ipa_flt_rule_add));
flt_rule_entry.at_rear = true;
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
index c4222f7cef7c..429574878d1a 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
@@ -705,7 +705,7 @@ failure:
for (j = 0; j < i; j++) {
next_pkt = list_next_entry(tx_pkt, link);
list_del(&tx_pkt->link);
- if (desc[i].type != IPA_DATA_DESC_SKB_PAGED) {
+ if (desc[j].type != IPA_DATA_DESC_SKB_PAGED) {
dma_unmap_single(ipa3_ctx->pdev, tx_pkt->mem.phys_base,
tx_pkt->mem.size,
DMA_TO_DEVICE);