projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d61d6de
)
RDMA/i40iw: Fix a race condition
author
Bart Van Assche
<
[email protected]
>
Wed, 11 Oct 2017 17:49:02 +0000
(10:49 -0700)
committer
Doug Ledford
<
[email protected]
>
Sun, 15 Oct 2017 00:47:06 +0000
(20:47 -0400)
Use the proper primitives to dereference the RCU pointer
upper_dev->ip_ptr. Compile-tested only.
Signed-off-by: Bart Van Assche <
[email protected]
>
Reviewed-by: Shiraz Saleem <
[email protected]
>
Signed-off-by: Doug Ledford <
[email protected]
>
drivers/infiniband/hw/i40iw/i40iw_utils.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/i40iw/i40iw_utils.c
b/drivers/infiniband/hw/i40iw/i40iw_utils.c
index e52dbbb4165ec555d94eb5f55f5310c71562b387..7304189b62ef893d24c4e3a65a1d8a280d26bdb9 100644
(file)
--- a/
drivers/infiniband/hw/i40iw/i40iw_utils.c
+++ b/
drivers/infiniband/hw/i40iw/i40iw_utils.c
@@
-168,11
+168,16
@@
int i40iw_inetaddr_event(struct notifier_block *notifier,
if (netdev != event_netdev)
return NOTIFY_DONE;
- if (upper_dev)
- local_ipaddr = ntohl(
- ((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address);
- else
+ if (upper_dev) {
+ struct in_device *in;
+
+ rcu_read_lock();
+ in = __in_dev_get_rcu(upper_dev);
+ local_ipaddr = ntohl(in->ifa_list->ifa_address);
+ rcu_read_unlock();
+ } else {
local_ipaddr = ntohl(ifa->ifa_address);
+ }
switch (event) {
case NETDEV_DOWN:
action = I40IW_ARP_DELETE;