netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anish Bhatt <anish@chelsio.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, hch@infradead.org, kxie@chelsio.com,
	manojmalviya@chelsio.com, aaron.lu@intel.com,
	xiyou.wangcong@gmail.com, fengguang.wu@intel.com,
	Anish Bhatt <anish@chelsio.com>
Subject: [PATCH net-next] cxgb4i : remove spurious use of rcu
Date: Sat,  2 Aug 2014 15:50:44 -0700	[thread overview]
Message-ID: <1407019844-21148-1-git-send-email-anish@chelsio.com> (raw)

As pointed out by the intel guys, there is no need to hold rcu read lock in
cxgbi_inet6addr_handler(), this patch removes it.

Fixes: 759a0cc5a3e1 ("cxgb4i: Add ipv6 code to driver, call into libcxgbi ipv6
api")
Signed-off-by: Anish Bhatt <anish@chelsio.com>
---
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index a4a4e98effdd..d31f9e600639 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -1646,25 +1646,22 @@ static int cxgbi_inet6addr_handler(struct notifier_block *this,
 	struct cxgbi_device *cdev;
 	int ret = NOTIFY_DONE;
 
-	rcu_read_lock();
-
 	if (event_dev->priv_flags & IFF_802_1Q_VLAN)
 		event_dev = vlan_dev_real_dev(event_dev);
 
 	cdev = cxgbi_device_find_by_netdev(event_dev, NULL);
-	if (!cdev) {
-		rcu_read_unlock();
+
+	if (!cdev)
 		return ret;
-	}
+
 	switch (event) {
 	case NETDEV_UP:
 		ret = cxgb4_clip_get(event_dev,
 				     (const struct in6_addr *)
 				     ((ifa)->addr.s6_addr));
-		if (ret < 0) {
-			rcu_read_unlock();
+		if (ret < 0)
 			return ret;
-		}
+
 		ret = NOTIFY_OK;
 		break;
 
@@ -1679,7 +1676,6 @@ static int cxgbi_inet6addr_handler(struct notifier_block *this,
 		break;
 	}
 
-	rcu_read_unlock();
 	return ret;
 }
 
-- 
2.0.3

             reply	other threads:[~2014-08-02 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-02 22:50 Anish Bhatt [this message]
2014-08-03  3:34 ` [PATCH net-next] cxgb4i : remove spurious use of rcu 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=1407019844-21148-1-git-send-email-anish@chelsio.com \
    --to=anish@chelsio.com \
    --cc=aaron.lu@intel.com \
    --cc=davem@davemloft.net \
    --cc=fengguang.wu@intel.com \
    --cc=hch@infradead.org \
    --cc=kxie@chelsio.com \
    --cc=manojmalviya@chelsio.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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 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).