Re: [PATCH net v3 1/2] smsc911x: only update stats when interface is up

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

 



On Wed, 22 Mar 2023 08:19:58 +0100 Wolfram Sang wrote:
> -	smsc911x_tx_update_txcounters(dev);
> -	dev->stats.rx_dropped += smsc911x_reg_read(pdata, RX_DROP);
> +
> +	if (netif_running(dev)) {
> +		smsc911x_tx_update_txcounters(dev);
> +		dev->stats.rx_dropped += smsc911x_reg_read(pdata, RX_DROP);
> +	}

Same problem as on the renesas patch, netif_running() can return true
before ndo->open() is called. And stats can be read with just the RCU
lock (via procfs).

Maybe we should add a false-negative version of netif_running() ?
__LINK_STATE_START*ED* ?



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux