All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wei Jie Law" <law.wei.jie@gt.tech.gov.sg>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH net v2 1/2] net: usb: lan78xx: do not update statistics after a failed read
Date: Sun, 18 Oct 2026 06:20:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-175984@kernel.org> (raw)
In-Reply-To: <20261018061734.19488-2-law.wei.jie@gt.tech.gov.sg>

> From: Wei Jie Law <98lawweijie@gmail.com>
> 
> lan78xx_update_stats() reads the hardware counters into an on-stack
> struct lan78xx_statstage. If lan78xx_read_stats() fails, only the
> rollover check is skipped: the counters are still recomputed from the
> uninitialized stack buffer and stored in dev->stats.curr_stat, which is
> then reported to user space by ethtool -S.
> 
> Keep the previous values when the read fails.
> 
> Found by code review with LLM assistance. Tested together with the next
> patch, which makes short reads fail: with an emulated device, ethtool -S
> then keeps reporting the previous counters.
> 
> Fixes: 20ff55655a93 ("lan78xx: handle statistics counter rollover")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261018061734.19488-1-law.wei.jie@gt.tech.gov.sg?part=1


  reply	other threads:[~2026-10-18  6:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18  6:17 [PATCH net v2 0/2] net: usb: lan78xx: do not use uninitialized data after short reads Wei Jie Law
2026-10-18  6:17 ` [PATCH net v2 1/2] net: usb: lan78xx: do not update statistics after a failed read Wei Jie Law
2026-10-18  6:20   ` sashiko-bot [this message]
2026-10-18  6:17 ` [PATCH net v2 2/2] net: usb: lan78xx: reject short register and statistics reads Wei Jie Law
2026-10-18  6:20   ` sashiko-bot
2026-10-18 16:09   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-175984@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=law.wei.jie@gt.tech.gov.sg \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.