Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279153
b: refs/heads/master
c: 3ab0b24
h: refs/heads/master
i:
  279151: f2ced1c
v: v3
  • Loading branch information
Pablo Neira Ayuso committed Jan 1, 2012
1 parent da8189f commit 34788f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b236916a68d923acff15787b5439d7d684c17ae5
refs/heads/master: 3ab0b245aa550ea4670d096092ca8e8d5e14ac89
17 changes: 13 additions & 4 deletions trunk/net/netfilter/nfnetlink_acct.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int
nfnl_acct_get(struct sock *nfnl, struct sk_buff *skb,
const struct nlmsghdr *nlh, const struct nlattr * const tb[])
{
int ret = 0;
int ret = -ENOENT;
struct nf_acct *cur;
char *acct_name;

Expand All @@ -186,17 +186,26 @@ nfnl_acct_get(struct sock *nfnl, struct sk_buff *skb,
continue;

skb2 = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (skb2 == NULL)
if (skb2 == NULL) {
ret = -ENOMEM;
break;
}

ret = nfnl_acct_fill_info(skb2, NETLINK_CB(skb).pid,
nlh->nlmsg_seq,
NFNL_MSG_TYPE(nlh->nlmsg_type),
NFNL_MSG_ACCT_NEW, cur);
if (ret <= 0)
if (ret <= 0) {
kfree_skb(skb2);
break;
}
ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).pid,
MSG_DONTWAIT);
if (ret > 0)
ret = 0;

break;
/* this avoids a loop in nfnetlink. */
return ret == -EAGAIN ? -ENOBUFS : ret;
}
return ret;
}
Expand Down

0 comments on commit 34788f7

Please sign in to comment.