mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: stf_xl@wp.pl, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: ethernet: ax88796: initialize all fields of eeprom_93cx6 struct
Date: Fri, 24 Jul 2026 14:04:34 +0100	[thread overview]
Message-ID: <c597273c-4fc7-4d3c-8886-6f8be5dc72f9@linux.dev> (raw)
In-Reply-To: <20260724083411.8562-1-stf_xl@wp.pl>

On 24/07/2026 09:34, 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.
> 
> Fixes: 7738a7ab9d12 ("misc: eeprom: eeprom_93cx6: Add quirk for extra read clock cycle")
> Cc: stable@kernel.org # v6.13+
> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
> ---
>   drivers/net/ethernet/8390/ax88796.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
> index e1695d0fbd8b..5ee1fbafdcfc 100644
> --- a/drivers/net/ethernet/8390/ax88796.c
> +++ b/drivers/net/ethernet/8390/ax88796.c
> @@ -722,12 +722,12 @@ static int ax_init_dev(struct net_device *dev)
>   #ifdef CONFIG_AX88796_93CX6
>   	if (ax->plat->flags & AXFLG_HAS_93CX6) {
>   		unsigned char mac_addr[ETH_ALEN];
> -		struct eeprom_93cx6 eeprom;
> -
> -		eeprom.data = ei_local;
> -		eeprom.register_read = ax_eeprom_register_read;
> -		eeprom.register_write = ax_eeprom_register_write;
> -		eeprom.width = PCI_EEPROM_WIDTH_93C56;
> +		struct eeprom_93cx6 eeprom = {
> +			.data = ei_local,
> +			.register_read = ax_eeprom_register_read,
> +			.register_write = ax_eeprom_register_write,
> +			.width = PCI_EEPROM_WIDTH_93C56,
> +		};
>   
>   		eeprom_93cx6_multiread(&eeprom, 0,
>   				       (__le16 __force *)mac_addr,

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

  parent reply	other threads:[~2026-07-24 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  8:34 stf_xl
2026-07-24 12:57 ` Andrew Lunn
2026-07-24 15:04   ` Stanislaw Gruszka
2026-07-24 16:05     ` David Laight
2026-07-24 13:04 ` Vadim Fedorenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-24  8:32 stf_xl

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=c597273c-4fc7-4d3c-8886-6f8be5dc72f9@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --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

all inboxes | Powered by JetHome®