From 5103cff0c0831acf208f572caca9379bbed63be1 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 26 Jun 2012 21:23:42 -0700 Subject: [PATCH] --- yaml --- r: 314639 b: refs/heads/master c: 62566ca55de3a329ef2569d7e7c9d0a326abede2 h: refs/heads/master i: 314637: a8b3793ddcfed4bfd935bd0ad66dd0a8aea1d881 314635: f2c0cce18cfcb406cde99f0b131e1e51a711c9fa 314631: cd03060748994a533dd11b7b93734809122e97e2 314623: 6498535608260fbd1777a21e6acac17b05abfbec v: v3 --- [refs] | 2 +- trunk/net/bridge/netfilter/ebt_ulog.c | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 45ffa412f919..fe298c169ac6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a8edf8a690817ebfe68aa14c4bc482f62699077f +refs/heads/master: 62566ca55de3a329ef2569d7e7c9d0a326abede2 diff --git a/trunk/net/bridge/netfilter/ebt_ulog.c b/trunk/net/bridge/netfilter/ebt_ulog.c index 5449294bdd5e..1bd173218f7b 100644 --- a/trunk/net/bridge/netfilter/ebt_ulog.c +++ b/trunk/net/bridge/netfilter/ebt_ulog.c @@ -145,19 +145,24 @@ static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb, if (!ub->skb) { if (!(ub->skb = ulog_alloc_skb(size))) - goto alloc_failure; + goto unlock; } else if (size > skb_tailroom(ub->skb)) { ulog_send(group); if (!(ub->skb = ulog_alloc_skb(size))) - goto alloc_failure; + goto unlock; } - nlh = NLMSG_PUT(ub->skb, 0, ub->qlen, 0, - size - NLMSG_ALIGN(sizeof(*nlh))); + nlh = nlmsg_put(ub->skb, 0, ub->qlen, 0, + size - NLMSG_ALIGN(sizeof(*nlh)), 0); + if (!nlh) { + kfree(ub->skb); + ub->skb = NULL; + goto unlock; + } ub->qlen++; - pm = NLMSG_DATA(nlh); + pm = nlmsg_data(nlh); /* Fill in the ulog data */ pm->version = EBT_ULOG_VERSION; @@ -209,14 +214,6 @@ static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb, unlock: spin_unlock_bh(lock); - - return; - -nlmsg_failure: - pr_debug("error during NLMSG_PUT. This should " - "not happen, please report to author.\n"); -alloc_failure: - goto unlock; } /* this function is registered with the netfilter core */