Merge "msm: ipa: fix multiple static analysis issues"

This commit is contained in:
Linux Build Service Account 2016-08-03 04:58:36 -07:00 committed by Gerrit - the friendly Code Review server
commit b5327d1b34
3 changed files with 15 additions and 22 deletions

View file

@ -276,8 +276,6 @@ fail_ep_exists:
*/
int ipa2_disconnect_mhi_pipe(u32 clnt_hdl)
{
struct ipa_ep_context *ep;
IPA_MHI_FUNC_ENTRY();
if (clnt_hdl >= ipa_ctx->ipa_num_pipes) {
@ -290,7 +288,8 @@ int ipa2_disconnect_mhi_pipe(u32 clnt_hdl)
return -EINVAL;
}
ep->valid = 0;
ipa_ctx->ep[clnt_hdl].valid = 0;
ipa_delete_dflt_flt_rules(clnt_hdl);
IPA_MHI_DBG("client (ep: %d) disconnected\n", clnt_hdl);
@ -302,14 +301,13 @@ int ipa2_mhi_resume_channels_internal(enum ipa_client_type client,
bool LPTransitionRejected, bool brstmode_enabled,
union __packed gsi_channel_scratch ch_scratch, u8 index)
{
int i;
int res;
IPA_MHI_FUNC_ENTRY();
res = ipa_uc_mhi_resume_channel(index, LPTransitionRejected);
if (res) {
IPA_MHI_ERR("failed to suspend channel %d error %d\n",
i, res);
IPA_MHI_ERR("failed to suspend channel %u error %d\n",
index, res);
return res;
}

View file

@ -1899,44 +1899,43 @@ static int ipa3_q6_clean_q6_tables(void)
if (ipa3_q6_clean_q6_flt_tbls(IPA_IP_v4, IPA_RULE_HASHABLE)) {
IPAERR("failed to clean q6 flt tbls (v4/hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_flt_tbls(IPA_IP_v6, IPA_RULE_HASHABLE)) {
IPAERR("failed to clean q6 flt tbls (v6/hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_flt_tbls(IPA_IP_v4, IPA_RULE_NON_HASHABLE)) {
IPAERR("failed to clean q6 flt tbls (v4/non-hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_flt_tbls(IPA_IP_v6, IPA_RULE_NON_HASHABLE)) {
IPAERR("failed to clean q6 flt tbls (v6/non-hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_rt_tbls(IPA_IP_v4, IPA_RULE_HASHABLE)) {
IPAERR("failed to clean q6 rt tbls (v4/hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_rt_tbls(IPA_IP_v6, IPA_RULE_HASHABLE)) {
IPAERR("failed to clean q6 rt tbls (v6/hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_rt_tbls(IPA_IP_v4, IPA_RULE_NON_HASHABLE)) {
IPAERR("failed to clean q6 rt tbls (v4/non-hashable)\n");
goto bail_desc;
return -EFAULT;
}
if (ipa3_q6_clean_q6_rt_tbls(IPA_IP_v6, IPA_RULE_NON_HASHABLE)) {
IPAERR("failed to clean q6 rt tbls (v6/non-hashable)\n");
goto bail_desc;
return -EFAULT;
}
/* Flush rules cache */
desc = kzalloc(sizeof(struct ipa3_desc), GFP_KERNEL);
if (!desc) {
IPAERR("failed to allocate memory\n");
retval = -ENOMEM;
goto bail_dma;
return -ENOMEM;
}
flush.v4_flt = true;
@ -1953,6 +1952,7 @@ static int ipa3_q6_clean_q6_tables(void)
&reg_write_cmd, false);
if (!cmd_pyld) {
IPAERR("fail construct register_write imm cmd\n");
retval = -EFAULT;
goto bail_desc;
}
desc->opcode =
@ -1969,9 +1969,9 @@ static int ipa3_q6_clean_q6_tables(void)
}
ipahal_destroy_imm_cmd(cmd_pyld);
bail_desc:
kfree(desc);
bail_dma:
IPADBG("Done - retval = %d\n", retval);
return retval;
}

View file

@ -549,11 +549,6 @@ int ipa3_mhi_resume_channels_internal(enum ipa_client_type client,
return res;
}
}
if (res) {
IPA_MHI_ERR("failed to resume channel error %d\n",
res);
return res;
}
res = gsi_start_channel(ep->gsi_chan_hdl);
if (res) {