Merge "msm: ipa: fix multiple static analysis issues"
This commit is contained in:
commit
b5327d1b34
3 changed files with 15 additions and 22 deletions
|
@ -276,8 +276,6 @@ fail_ep_exists:
|
||||||
*/
|
*/
|
||||||
int ipa2_disconnect_mhi_pipe(u32 clnt_hdl)
|
int ipa2_disconnect_mhi_pipe(u32 clnt_hdl)
|
||||||
{
|
{
|
||||||
struct ipa_ep_context *ep;
|
|
||||||
|
|
||||||
IPA_MHI_FUNC_ENTRY();
|
IPA_MHI_FUNC_ENTRY();
|
||||||
|
|
||||||
if (clnt_hdl >= ipa_ctx->ipa_num_pipes) {
|
if (clnt_hdl >= ipa_ctx->ipa_num_pipes) {
|
||||||
|
@ -290,7 +288,8 @@ int ipa2_disconnect_mhi_pipe(u32 clnt_hdl)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ep->valid = 0;
|
ipa_ctx->ep[clnt_hdl].valid = 0;
|
||||||
|
|
||||||
ipa_delete_dflt_flt_rules(clnt_hdl);
|
ipa_delete_dflt_flt_rules(clnt_hdl);
|
||||||
|
|
||||||
IPA_MHI_DBG("client (ep: %d) disconnected\n", 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,
|
bool LPTransitionRejected, bool brstmode_enabled,
|
||||||
union __packed gsi_channel_scratch ch_scratch, u8 index)
|
union __packed gsi_channel_scratch ch_scratch, u8 index)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
IPA_MHI_FUNC_ENTRY();
|
IPA_MHI_FUNC_ENTRY();
|
||||||
res = ipa_uc_mhi_resume_channel(index, LPTransitionRejected);
|
res = ipa_uc_mhi_resume_channel(index, LPTransitionRejected);
|
||||||
if (res) {
|
if (res) {
|
||||||
IPA_MHI_ERR("failed to suspend channel %d error %d\n",
|
IPA_MHI_ERR("failed to suspend channel %u error %d\n",
|
||||||
i, res);
|
index, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)) {
|
if (ipa3_q6_clean_q6_flt_tbls(IPA_IP_v4, IPA_RULE_HASHABLE)) {
|
||||||
IPAERR("failed to clean q6 flt tbls (v4/hashable)\n");
|
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)) {
|
if (ipa3_q6_clean_q6_flt_tbls(IPA_IP_v6, IPA_RULE_HASHABLE)) {
|
||||||
IPAERR("failed to clean q6 flt tbls (v6/hashable)\n");
|
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)) {
|
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");
|
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)) {
|
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");
|
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)) {
|
if (ipa3_q6_clean_q6_rt_tbls(IPA_IP_v4, IPA_RULE_HASHABLE)) {
|
||||||
IPAERR("failed to clean q6 rt tbls (v4/hashable)\n");
|
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)) {
|
if (ipa3_q6_clean_q6_rt_tbls(IPA_IP_v6, IPA_RULE_HASHABLE)) {
|
||||||
IPAERR("failed to clean q6 rt tbls (v6/hashable)\n");
|
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)) {
|
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");
|
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)) {
|
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");
|
IPAERR("failed to clean q6 rt tbls (v6/non-hashable)\n");
|
||||||
goto bail_desc;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush rules cache */
|
/* Flush rules cache */
|
||||||
desc = kzalloc(sizeof(struct ipa3_desc), GFP_KERNEL);
|
desc = kzalloc(sizeof(struct ipa3_desc), GFP_KERNEL);
|
||||||
if (!desc) {
|
if (!desc) {
|
||||||
IPAERR("failed to allocate memory\n");
|
IPAERR("failed to allocate memory\n");
|
||||||
retval = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto bail_dma;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flush.v4_flt = true;
|
flush.v4_flt = true;
|
||||||
|
@ -1953,6 +1952,7 @@ static int ipa3_q6_clean_q6_tables(void)
|
||||||
®_write_cmd, false);
|
®_write_cmd, false);
|
||||||
if (!cmd_pyld) {
|
if (!cmd_pyld) {
|
||||||
IPAERR("fail construct register_write imm cmd\n");
|
IPAERR("fail construct register_write imm cmd\n");
|
||||||
|
retval = -EFAULT;
|
||||||
goto bail_desc;
|
goto bail_desc;
|
||||||
}
|
}
|
||||||
desc->opcode =
|
desc->opcode =
|
||||||
|
@ -1969,9 +1969,9 @@ static int ipa3_q6_clean_q6_tables(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ipahal_destroy_imm_cmd(cmd_pyld);
|
ipahal_destroy_imm_cmd(cmd_pyld);
|
||||||
|
|
||||||
bail_desc:
|
bail_desc:
|
||||||
kfree(desc);
|
kfree(desc);
|
||||||
bail_dma:
|
|
||||||
IPADBG("Done - retval = %d\n", retval);
|
IPADBG("Done - retval = %d\n", retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -549,11 +549,6 @@ int ipa3_mhi_resume_channels_internal(enum ipa_client_type client,
|
||||||
return res;
|
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);
|
res = gsi_start_channel(ep->gsi_chan_hdl);
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue