Search Linux Wireless

Re: mesh RCU issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 13, 2011 at 5:00 PM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> On Fri, 2011-05-13 at 13:28 -0700, Javier Cardona wrote:
>
>> diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
>> index 83ce48e..1db8bba 100644
>> --- a/net/mac80211/mesh_pathtbl.c
>> +++ b/net/mac80211/mesh_pathtbl.c
> [snip]
>
> With this patch, I get the warnings below.

Thanks.  Any ideas on how to fix sparse?  I'd like to see those too :)

> The locking ones are definitely genuine bugs,

I'm not sure I fully understand the sparse message... would this fix
the two locking warnings?

diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 83ce48e..fbf0c28 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -376,8 +376,10 @@ void mesh_mpath_table_grow(void)

        rcu_read_lock();
        newtbl = mesh_table_alloc(rcu_dereference(mesh_paths)->size_order + 1);
-       if (!newtbl)
+       if (!newtbl) {
+               rcu_read_unlock();
                return;
+       }
        write_lock_bh(&pathtbl_resize_lock);
        oldtbl = mesh_paths;
        if (mesh_table_grow(mesh_paths, newtbl) < 0) {
@@ -400,8 +402,10 @@ void mesh_mpp_table_grow(void)

        rcu_read_lock();
        newtbl = mesh_table_alloc(rcu_dereference(mpp_paths)->size_order + 1);
-       if (!newtbl)
+       if (!newtbl) {
+               rcu_read_unlock();
                return;
+       }
        write_lock_bh(&pathtbl_resize_lock);
        oldtbl = mpp_paths;
        if (mesh_table_grow(mpp_paths, newtbl) < 0) {



Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux