lkml.org 
[lkml]   [2023]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net v3 1/2] smsc911x: only update stats when interface is up
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* ?

\
 
 \ /
  Last update: 2023-03-27 01:15    [W:0.042 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site