From: Dan Carpenter <error27@gmail.com>
To: Greg Rose <gregory.v.rose@intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Patrick McHardy <kaber@trash.net>,
Chris Wright <chrisw@sous-sol.org>,
"David S. Miller" <davem@davemloft.net>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: [patch -next] rtnetlink: unlock on error path in netlink_dump()
Date: Wed, 15 Jun 2011 16:11:42 +0300 [thread overview]
Message-ID: <20110615131142.GE23739@shale.localdomain> (raw)
In c7ac8679bec939 "rtnetlink: Compute and store minimum ifinfo dump
size", we moved the allocation under the lock so we need to unlock
on error path.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 0b92f7549..ca5276c 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1676,7 +1676,7 @@ static int netlink_dump(struct sock *sk)
skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL);
if (!skb)
- goto errout;
+ goto errout_skb;
len = cb->dump(skb, cb);
@@ -1716,7 +1716,6 @@ static int netlink_dump(struct sock *sk)
errout_skb:
mutex_unlock(nlk->cb_mutex);
kfree_skb(skb);
-errout:
return err;
}
next reply other threads:[~2011-06-15 13:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 13:11 Dan Carpenter [this message]
2011-06-17 3:51 ` [patch -next] rtnetlink: unlock on error path in netlink_dump() David Miller
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=20110615131142.GE23739@shale.localdomain \
--to=error27@gmail.com \
--cc=chrisw@sous-sol.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gregory.v.rose@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=kaber@trash.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox