diff options
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r-- | net/netlink/af_netlink.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index eb164787326..eea6817fa9f 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1333,16 +1333,12 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, return err; if (msg->msg_namelen) { - if (addr->nl_family != AF_NETLINK) { - err = -EINVAL; - goto out; - } + if (addr->nl_family != AF_NETLINK) + return -EINVAL; dst_pid = addr->nl_pid; dst_group = ffs(addr->nl_groups); - if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND)) { - err = -EPERM; - goto out; - } + if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND)) + return -EPERM; } else { dst_pid = nlk->dst_pid; dst_group = nlk->dst_group; @@ -1394,8 +1390,6 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT); out: - scm_destroy(siocb->scm); - siocb->scm = NULL; return err; } |