Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: stf_xl@wp.pl
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: ethernet: ax88796: initialize all fields of eeprom_93cx6 struct
Date: Fri, 24 Jul 2026 14:57:33 +0200	[thread overview]
Message-ID: <5df6efd5-ebc2-4049-9501-e013bf68c51a@lunn.ch> (raw)
In-Reply-To: <20260724083411.8562-1-stf_xl@wp.pl>

On Fri, Jul 24, 2026 at 10:34:11AM +0200, stf_xl@wp.pl wrote:
> From: Stanislaw Gruszka <stf_xl@wp.pl>
> 
> Commit 7738a7ab9d12 ("misc: eeprom: eeprom_93cx6: Add quirk for extra
> read clock cycle") added extra 'quirk' field to struct eeprom_93cx6,
> which change how the data is read.
> 
> Some existing users of eeprom_93cx6, including ax88796 driver, allocate
> the structure on the stack without initialization of all the fields.
> As a result, the added quirk field has undefined value, what can
> randomly cause reading wrong data from the EEPROM.
> 
> Fix by using designated initialization.

The problem with this solution is that the next time another member is
added, it breaks again.

struct eeprom_93cx6 eeprom = {0};

Will initialise all fields to 0, and then you can use the existing
code to set those fields as needed.

    Andrew

---
pw-bot: cr

  reply	other threads:[~2026-07-24 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  8:34 [PATCH] net: ethernet: ax88796: initialize all fields of eeprom_93cx6 struct stf_xl
2026-07-24 12:57 ` Andrew Lunn [this message]
2026-07-24 13:04 ` Vadim Fedorenko

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=5df6efd5-ebc2-4049-9501-e013bf68c51a@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stf_xl@wp.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox