Commit 958d6145 authored by Jason Xing's avatar Jason Xing Committed by Paolo Abeni

netrom: Fix a data-race around sysctl_netrom_default_path_quality

We need to protect the reader reading sysctl_netrom_default_path_quality
because the value can be changed concurrently.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarJason Xing <kernelxing@tencent.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 811b3f9b
...@@ -153,7 +153,7 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic, ...@@ -153,7 +153,7 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic,
nr_neigh->digipeat = NULL; nr_neigh->digipeat = NULL;
nr_neigh->ax25 = NULL; nr_neigh->ax25 = NULL;
nr_neigh->dev = dev; nr_neigh->dev = dev;
nr_neigh->quality = sysctl_netrom_default_path_quality; nr_neigh->quality = READ_ONCE(sysctl_netrom_default_path_quality);
nr_neigh->locked = 0; nr_neigh->locked = 0;
nr_neigh->count = 0; nr_neigh->count = 0;
nr_neigh->number = nr_neigh_no++; nr_neigh->number = nr_neigh_no++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment