From: Ursula Braun <ubraun@linux.vnet.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
ubraun@linux.vnet.ibm.com
Subject: [PATCH net 2/7] s390/qeth: use ip_lock for hsuid configuration
Date: Thu, 15 Sep 2016 14:39:22 +0200 [thread overview]
Message-ID: <20160915123927.86579-3-ubraun@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160915123927.86579-1-ubraun@linux.vnet.ibm.com>
qeth_l3_dev_hsuid_store() changes the ip hash table, which
requires the ip_lock.
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l3_sys.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 65645b1..0e00a5c 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -297,7 +297,9 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev,
addr->u.a6.pfxlen = 0;
addr->type = QETH_IP_TYPE_NORMAL;
+ spin_lock_bh(&card->ip_lock);
qeth_l3_delete_ip(card, addr);
+ spin_unlock_bh(&card->ip_lock);
kfree(addr);
}
@@ -329,7 +331,10 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev,
addr->type = QETH_IP_TYPE_NORMAL;
} else
return -ENOMEM;
+
+ spin_lock_bh(&card->ip_lock);
qeth_l3_add_ip(card, addr);
+ spin_unlock_bh(&card->ip_lock);
kfree(addr);
return count;
--
2.8.4
next prev parent reply other threads:[~2016-09-15 12:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 12:39 [PATCH net 0/7] 390: qeth patches Ursula Braun
2016-09-15 12:39 ` [PATCH net 1/7] qeth: restore device features after recovery Ursula Braun
2016-09-15 12:39 ` Ursula Braun [this message]
2016-09-15 12:39 ` [PATCH net 3/7] s390/qeth: allow hsuid configuration in DOWN state Ursula Braun
2016-09-15 12:39 ` [PATCH net 4/7] qeth: check not more than 16 SBALEs on the completion queue Ursula Braun
2016-09-15 12:39 ` [PATCH net 5/7] qeth: do not limit number of gso segments Ursula Braun
2016-09-15 12:39 ` [PATCH net 6/7] qeth: do not turn on SG per default Ursula Braun
2016-09-15 12:39 ` [PATCH net 7/7] s390/qeth: fix setting VIPA address Ursula Braun
2016-09-16 8:31 ` [PATCH net 0/7] 390: qeth patches 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=20160915123927.86579-3-ubraun@linux.vnet.ibm.com \
--to=ubraun@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=schwidefsky@de.ibm.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).