All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: jamal <hadi@cyberus.ca>
Cc: Maillist netdev <netdev@oss.sgi.com>
Subject: [PATCH PKT_SCHED 12/17]: Fix missing unlock in ipt action error path
Date: Thu, 30 Dec 2004 04:40:33 +0100	[thread overview]
Message-ID: <41D378B1.40202@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 46 bytes --]

Fix missing unlock in ipt action error path.


[-- Attachment #2: 12.diff --]
[-- Type: text/x-patch, Size: 1122 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/30 03:02:56+01:00 kaber@coreworks.de 
#   [PKT_SCHED]: Fix missing unlock in ipt action error path
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/sched/ipt.c
#   2004/12/30 02:57:03+01:00 kaber@coreworks.de +6 -4
#   [PKT_SCHED]: Fix missing unlock in ipt action error path
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c
--- a/net/sched/ipt.c	2004-12-30 04:01:46 +01:00
+++ b/net/sched/ipt.c	2004-12-30 04:01:46 +01:00
@@ -248,9 +248,11 @@
 	p->bstats.bytes += skb->len;
 	p->bstats.packets++;
 
-	if (skb_cloned(skb) ) {
-		if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
-			return -1;
+	if (skb_cloned(skb)) {
+		if (unlikely(pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) {
+			result = -1;
+			goto out_unlock;
+		}
 	}
 	/* yes, we have to worry about both in and out dev
 	 worry later - danger - this API seems to have changed
@@ -275,9 +277,9 @@
 		result = TC_POLICE_OK;
 		break;
 	}
+out_unlock:
 	spin_unlock(&p->lock);
 	return result;
-
 }
 
 static int

                 reply	other threads:[~2004-12-30  3:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41D378B1.40202@trash.net \
    --to=kaber@trash.net \
    --cc=hadi@cyberus.ca \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.