diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2013-06-25 10:50:05 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-06-28 10:04:36 -0400 |
commit | f9eb7bf424e766e00bbc6d69fd7eaaf4bd003cf9 (patch) | |
tree | 38ff024994e67c9bfaf8ae9a6b4d86a0e12327a3 /drivers/block | |
parent | 6110d70bdf99f9d0448f1f61798542e3b123b42a (diff) |
drbd: Fix rcu_read_lock balance on error path
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 9e3f441e7e84..0936d6aabef9 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -2658,7 +2658,6 @@ int nla_put_status_info(struct sk_buff *skb, struct drbd_conf *mdev, | |||
2658 | const struct sib_info *sib) | 2658 | const struct sib_info *sib) |
2659 | { | 2659 | { |
2660 | struct state_info *si = NULL; /* for sizeof(si->member); */ | 2660 | struct state_info *si = NULL; /* for sizeof(si->member); */ |
2661 | struct net_conf *nc; | ||
2662 | struct nlattr *nla; | 2661 | struct nlattr *nla; |
2663 | int got_ldev; | 2662 | int got_ldev; |
2664 | int err = 0; | 2663 | int err = 0; |
@@ -2688,13 +2687,19 @@ int nla_put_status_info(struct sk_buff *skb, struct drbd_conf *mdev, | |||
2688 | goto nla_put_failure; | 2687 | goto nla_put_failure; |
2689 | 2688 | ||
2690 | rcu_read_lock(); | 2689 | rcu_read_lock(); |
2691 | if (got_ldev) | 2690 | if (got_ldev) { |
2692 | if (disk_conf_to_skb(skb, rcu_dereference(mdev->ldev->disk_conf), exclude_sensitive)) | 2691 | struct disk_conf *disk_conf; |
2693 | goto nla_put_failure; | ||
2694 | 2692 | ||
2695 | nc = rcu_dereference(mdev->tconn->net_conf); | 2693 | disk_conf = rcu_dereference(mdev->ldev->disk_conf); |
2696 | if (nc) | 2694 | err = disk_conf_to_skb(skb, disk_conf, exclude_sensitive); |
2697 | err = net_conf_to_skb(skb, nc, exclude_sensitive); | 2695 | } |
2696 | if (!err) { | ||
2697 | struct net_conf *nc; | ||
2698 | |||
2699 | nc = rcu_dereference(mdev->tconn->net_conf); | ||
2700 | if (nc) | ||
2701 | err = net_conf_to_skb(skb, nc, exclude_sensitive); | ||
2702 | } | ||
2698 | rcu_read_unlock(); | 2703 | rcu_read_unlock(); |
2699 | if (err) | 2704 | if (err) |
2700 | goto nla_put_failure; | 2705 | goto nla_put_failure; |