Commit 98d0e38f authored by Pekka Pessi's avatar Pekka Pessi
Browse files

soa.c: fix su_seterrno() usage

MeeGo Coverity issue CID#11749
parent 8e65ca4e
......@@ -402,7 +402,7 @@ int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
ss ? ss->ss_actions->soa_name : "", (void *)ss));
if (ss == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
ta_start(ta, tag, value);
......@@ -624,7 +624,7 @@ int soa_get_params(soa_session_t const *ss,
ss ? ss->ss_actions->soa_name : "", (void *)ss));
if (ss == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
ta_start(ta, tag, value);
......@@ -856,7 +856,7 @@ int soa_get_capability_sdp(soa_session_t const *ss,
(void *)return_sdp, (void *)return_sdp_str, (void *)return_len));
if (ss == NULL)
return (void)su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
sdp = ss->ss_caps->ssd_sdp;
sdp_str = ss->ss_caps->ssd_str;
......@@ -992,7 +992,7 @@ int soa_get_user_sdp(soa_session_t const *ss,
(void *)return_sdp, (void *)return_sdp_str, (void *)return_len));
if (ss == NULL)
return (void)su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
sdp = ss->ss_user->ssd_sdp;
sdp_str = ss->ss_user->ssd_str;
......@@ -1109,7 +1109,7 @@ int soa_get_remote_sdp(soa_session_t const *ss,
(void *)return_sdp, (void *)return_sdp_str, (void *)return_len));
if (ss == NULL)
return (void)su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
sdp = ss->ss_remote->ssd_sdp;
sdp_str = ss->ss_remote->ssd_str;
......@@ -1225,7 +1225,7 @@ int soa_clear_remote_sdp(soa_session_t *ss)
ss ? ss->ss_actions->soa_name : "", (void *)ss));
if (!ss)
return (void)su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
ss->ss_unprocessed_remote = 0;
......@@ -1281,7 +1281,7 @@ int soa_get_local_sdp(soa_session_t const *ss,
(void *)return_sdp, (void *)return_sdp_str, (void *)return_len));
if (ss == NULL)
return (void)su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
sdp = ss->ss_local->ssd_sdp;
sdp_str = ss->ss_local->ssd_str;
......@@ -1393,7 +1393,7 @@ int soa_remote_sip_features(soa_session_t *ss,
/* Calls soa_base_remote_sip_features() by default */
return ss->ss_actions->soa_remote_sip_features(ss, supported, require);
else
return (void)su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
}
int soa_base_remote_sip_features(soa_session_t *ss,
......@@ -1438,27 +1438,27 @@ int soa_generate_offer(soa_session_t *ss,
/** @ERROR EFAULT Bad address. */
if (ss == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
/** @ERROR EALREADY An operation is already in progress */
if (ss->ss_in_progress)
return su_seterrno(EALREADY), -1;
return su_seterrno(EALREADY);
/** @ERROR EPROTO We have received offer, now we should send answer */
if (ss->ss_offer_recv && !ss->ss_answer_sent)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/** @ERROR EPROTO We have received SDP, but it has not been processed */
if (soa_has_received_sdp(ss))
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/** @ERROR EPROTO We have sent an offer, but have received no answer */
if (ss->ss_offer_sent && !ss->ss_answer_recv)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/** @ERROR EPROTO We have received offer. */
if (ss->ss_unprocessed_remote)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/* We should avoid actual operation unless always is true */
(void)always; /* We always regenerate offer */
......@@ -1527,19 +1527,19 @@ int soa_generate_answer(soa_session_t *ss,
/** @ERROR EFAULT Bad address as @a ss. */
if (ss == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
/** @ERROR EALREADY An operation is already in progress. */
if (ss->ss_in_progress)
return su_seterrno(EALREADY), -1;
return su_seterrno(EALREADY);
/** @ERROR EPROTO We have sent an offer, but have received no answer. */
if (ss->ss_offer_sent && !ss->ss_answer_recv)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/** @ERROR EPROTO We have not received offer. */
if (!ss->ss_unprocessed_remote)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/* Calls soa_static_generate_answer() by default. */
return ss->ss_actions->soa_generate_answer(ss, completed);
......@@ -1607,20 +1607,20 @@ int soa_process_answer(soa_session_t *ss,
/** @ERROR EFAULT Bad address as @a ss. */
if (ss == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
/** @ERROR EALREADY An operation is already in progress. */
if (ss->ss_in_progress)
return su_seterrno(EALREADY), -1;
return su_seterrno(EALREADY);
/** @ERROR EPROTO We have not sent an offer
or already have received answer. */
if (!ss->ss_offer_sent || ss->ss_answer_recv)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/** @ERROR EPROTO We have not received answer. */
if (!ss->ss_unprocessed_remote)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/**@sa soa_init_offer_answer(), soa_set_user_sdp(), soa_set_remote_sdp(),
* soa_get_local_sdp(), soa_generate_offer(), soa_generate_answer(),
......@@ -1688,16 +1688,16 @@ int soa_process_reject(soa_session_t *ss,
/** @ERROR EFAULT Bad address as @a ss. */
if (ss == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
/** @ERROR EALREADY An operation is already in progress. */
if (ss->ss_in_progress)
return su_seterrno(EALREADY), -1;
return su_seterrno(EALREADY);
/** @ERROR EPROTO We have not sent an offer
or already have received answer. */
if (!ss->ss_offer_sent || ss->ss_answer_recv)
return su_seterrno(EPROTO), -1;
return su_seterrno(EPROTO);
/**@sa soa_init_offer_answer(), soa_set_user_sdp(), soa_set_remote_sdp(),
* soa_get_local_sdp(), soa_generate_offer(), soa_generate_answer(),
......@@ -2049,7 +2049,7 @@ int soa_set_sdp(soa_session_t *ss,
new_version = !su_strnmatch(sdp_str, ssd->ssd_unparsed, str_len + 1);
}
else
return (void)su_seterrno(EINVAL), -1;
return su_seterrno(EINVAL);
if (!new_version) {
if (what == soa_remote_sdp_kind) {
......@@ -2275,7 +2275,7 @@ soa_init_sdp_connection_with_session(soa_session_t *ss,
char abuffer[64]; /* getting value from ss_address */
if (ss == NULL || c == NULL || buffer == NULL)
return su_seterrno(EFAULT), -1;
return su_seterrno(EFAULT);
address = ss->ss_address;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment