From 7ad2b15bc767f471ae12d4d72b5c734bde163d2a Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 28 Aug 2018 17:37:59 +0200 Subject: ipaccess: Return -EBADF when closing socket in ipaccess_bts_read_cb As we are closing the socket, there's no need for lower layers to continue handling it, so let's return -EBADF. Change-Id: I961b0ef7e598a09ce48a83038c0d90a415e0e11c --- src/input/ipaccess.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index cce1654..24a79ea 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -738,7 +738,6 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) LOGP(DLINP, LOGL_ERROR, "Unable to set signal link, " "closing socket.\n"); - ret = -EINVAL; goto err; } } @@ -758,7 +757,6 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) LOGP(DLINP, LOGL_ERROR, "Unable to set signal link, " "closing socket.\n"); - ret = -EINVAL; goto err; } } @@ -774,16 +772,14 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) if (e1i_ts->type == E1INP_TS_TYPE_NONE) { LOGP(DLINP, LOGL_ERROR, "Signalling link not initialized. Discarding." " port=%u msg_type=%u\n", link->port, msg_type); - ret = -EIO; goto err; } - + /* look up for some existing signaling link. */ sign_link = e1inp_lookup_sign_link(e1i_ts, hh->proto, 0); if (sign_link == NULL) { LOGP(DLINP, LOGL_ERROR, "no matching signalling link for " "hh->proto=0x%02x\n", hh->proto); - ret = -EIO; goto err; } msg->dst = sign_link; @@ -792,7 +788,6 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) if (!link->line->ops->sign_link) { LOGP(DLINP, LOGL_ERROR, "Fix your application, " "no action set for signalling messages.\n"); - ret = -ENOENT; goto err; } link->line->ops->sign_link(msg); @@ -801,7 +796,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) err: ipa_client_conn_close(link); msgb_free(msg); - return ret; + return -EBADF; } struct ipaccess_line { -- cgit v1.2.3