提交 b965b51c 编写于 作者: B Bart Van Assche 提交者: Doug Ledford

RDMA/i40iw: Fix a race condition

Use the proper primitives to dereference the RCU pointer
upper_dev->ip_ptr. Compile-tested only.
Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: NShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 d61d6de0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册