Search Linux Wireless

wilc1000: rtnl_is_locked() misuse

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

 



Hi,

I'm reporting you about misuse of rtnl_is_locked() in WILC_WFI_deinit_mon_interface() function.
Note, that rtnl_is_locked() *does not mean* rtnl is locked on the *current cpu*. This primitive
returns true in case of rtnl is locked somewhere in the system. So, it can't be used in the below
code:

int WILC_WFI_deinit_mon_interface(void)
{
        bool rollback_lock = false;

        if (wilc_wfi_mon) {
                if (rtnl_is_locked()) {			<------Mistake
                        rtnl_unlock();
                        rollback_lock = true;
                }
                unregister_netdev(wilc_wfi_mon);

                if (rollback_lock) {
                        rtnl_lock();
                        rollback_lock = false;
                }
                wilc_wfi_mon = NULL;
        }
        return 0;
}

Kirill



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux