netlink: Remove the dead code in netlink_close
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
06d5fe6b33
commit
6493022047
|
@ -719,7 +719,7 @@ enum
|
|||
PREFIX_UNSPEC,
|
||||
PREFIX_ADDRESS,
|
||||
PREFIX_CACHEINFO,
|
||||
PREFIX_MAX
|
||||
PREFIX_MAX = PREFIX_CACHEINFO
|
||||
};
|
||||
|
||||
struct prefix_cacheinfo
|
||||
|
@ -801,7 +801,7 @@ enum
|
|||
{
|
||||
NDUSEROPT_UNSPEC,
|
||||
NDUSEROPT_SRCADDR,
|
||||
NDUSEROPT_MAX
|
||||
NDUSEROPT_MAX = NDUSEROPT_SRCADDR
|
||||
};
|
||||
|
||||
/* This struct should be in sync with struct rtnl_link_stats64 */
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
FAR struct netlink_ext_ack *__extack = (extack); \
|
||||
if (__extack) \
|
||||
{ \
|
||||
__extack->msg = __msg; \
|
||||
__extack->_msg = __msg; \
|
||||
__extack->bad_attr = (attr); \
|
||||
} \
|
||||
} \
|
||||
|
@ -229,7 +229,7 @@ enum
|
|||
};
|
||||
|
||||
/* struct netlink_ext_ack - netlink extended ACK report struct
|
||||
* msg: message string to report - don't access directly, use
|
||||
* _msg: message string to report - don't access directly, use
|
||||
* nl_set_err_msg_attr
|
||||
* bad_attr: attribute with error
|
||||
* cookie: cookie data to return to userspace (for success)
|
||||
|
@ -238,7 +238,7 @@ enum
|
|||
|
||||
struct netlink_ext_ack
|
||||
{
|
||||
FAR const char *msg;
|
||||
FAR const char *_msg;
|
||||
FAR const struct nlattr *bad_attr;
|
||||
uint8_t cookie[NETLINK_MAX_COOKIE_LEN];
|
||||
uint8_t cookie_len;
|
||||
|
|
|
@ -744,7 +744,6 @@ static ssize_t netlink_recvmsg(FAR struct socket *psock,
|
|||
static int netlink_close(FAR struct socket *psock)
|
||||
{
|
||||
FAR struct netlink_conn_s *conn = psock->s_conn;
|
||||
int ret = OK;
|
||||
|
||||
/* Perform some pre-close operations for the NETLINK socket type. */
|
||||
|
||||
|
@ -758,14 +757,6 @@ static int netlink_close(FAR struct socket *psock)
|
|||
|
||||
conn->crefs = 0;
|
||||
netlink_free(psock->s_conn);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
/* Return with error code, but free resources. */
|
||||
|
||||
nerr("ERROR: netlink_close failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -774,7 +765,7 @@ static int netlink_close(FAR struct socket *psock)
|
|||
conn->crefs--;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET_NETLINK */
|
||||
|
|
Loading…
Reference in New Issue