* [PATCH] xfrm: fix a rcu_read_lock() imbalance in make_blackhole
@ 2012-09-18 8:40 roy.qing.li
2012-09-18 20:30 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: roy.qing.li @ 2012-09-18 8:40 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
if xfrm_policy_get_afinfo returns 0, it has already called rcu_read_unlock,
xfrm_policy_put_afinfo should not be called again.
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/xfrm/xfrm_policy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 741a32a..878835b 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1780,7 +1780,7 @@ static struct dst_entry *make_blackhole(struct net *net, u16 family,
if (!afinfo) {
dst_release(dst_orig);
- ret = ERR_PTR(-EINVAL);
+ return ERR_PTR(-EINVAL);
} else {
ret = afinfo->blackhole_route(net, dst_orig);
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfrm: fix a rcu_read_lock() imbalance in make_blackhole
2012-09-18 8:40 [PATCH] xfrm: fix a rcu_read_lock() imbalance in make_blackhole roy.qing.li
@ 2012-09-18 20:30 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-09-18 20:30 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
From: roy.qing.li@gmail.com
Date: Tue, 18 Sep 2012 16:40:10 +0800
> From: Li RongQing <roy.qing.li@gmail.com>
>
> if xfrm_policy_get_afinfo returns 0, it has already called rcu_read_unlock,
> xfrm_policy_put_afinfo should not be called again.
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
This bug exists in the 'net' tree too, where this lock is a read lock.
I've applied this patch and adjusted the commit log text to accomodate
to difference.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-18 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-18 8:40 [PATCH] xfrm: fix a rcu_read_lock() imbalance in make_blackhole roy.qing.li
2012-09-18 20:30 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).