public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	knv418@gmail.com, jiapeng.chong@linux.alibaba.com,
	ojaswin98@gmail.com, arnd@arndb.de, lee.jones@linaro.org,
	clrrm@isep.ipp.pt, fabioaiuto83@gmail.com, hdegoede@redhat.com,
	ross.schm.dev@gmail.com, insafonov@gmail.com
Subject: Re: [PATCH 7/8] staging: rtl: use eth_hw_addr_set()
Date: Wed, 3 Nov 2021 17:08:31 +0300	[thread overview]
Message-ID: <20211103140831.GV2794@kadam> (raw)
In-Reply-To: <20211103063624.075c75e0@kicinski-fedora-PC1C0HJN>

On Wed, Nov 03, 2021 at 06:36:24AM -0700, Jakub Kicinski wrote:
> On Wed, 3 Nov 2021 14:29:06 +0300 Dan Carpenter wrote:
> > >  	if (!priv->AutoloadFailFlag) {
> > > +		u8 addr[ETH_ALEN];
> > > +
> > >  		for (i = 0; i < 6; i += 2) {
> > >  			usValue = rtl92e_eeprom_read(dev,
> > >  				 (EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1);
> > > -			*(u16 *)(&dev->dev_addr[i]) = usValue;
> > > +			*(u16 *)(&addr[i]) = usValue;  
> > 
> > No this doesn't work.  It writes 2 bytes instead of one so it will
> > write one element beyond the end of addr[]. 
> 
> But the index moves by 2, IOW loop is only executed for i = 0, 2, 4.

Ah, right.  I missed that.

regards,
dan carpenter


  reply	other threads:[~2021-11-03 14:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 17:12 [PATCH 0/8] staging: prepare for const netdev->dev_addr Jakub Kicinski
2021-10-19 17:12 ` [PATCH 1/8] staging: use eth_hw_addr_set() Jakub Kicinski
2021-10-19 17:12 ` [PATCH 2/8] staging: use eth_hw_addr_set() instead of ether_addr_copy() Jakub Kicinski
2021-10-19 17:12 ` [PATCH 3/8] staging: use eth_hw_addr_set() for dev->addr_len cases Jakub Kicinski
2021-10-19 17:12 ` [PATCH 4/8] staging: qlge: use eth_hw_addr_set() Jakub Kicinski
2021-10-19 17:12 ` [PATCH 5/8] staging: rtl8712: prepare for const netdev->dev_addr Jakub Kicinski
2021-10-19 17:12 ` [PATCH 6/8] staging: unisys: use eth_hw_addr_set() Jakub Kicinski
2021-10-19 17:12 ` [PATCH 7/8] staging: rtl: " Jakub Kicinski
2021-11-03 11:29   ` Dan Carpenter
2021-11-03 13:36     ` Jakub Kicinski
2021-11-03 14:08       ` Dan Carpenter [this message]
2021-10-19 17:12 ` [PATCH 8/8] staging: use eth_hw_addr_set() in orphan drivers Jakub Kicinski
2021-10-20 16:53   ` Kees Cook
2021-10-19 17:34 ` [PATCH 0/8] staging: prepare for const netdev->dev_addr Greg KH
2021-10-19 18:01   ` Jakub Kicinski
2021-10-19 18:15     ` Greg KH

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=20211103140831.GV2794@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=arnd@arndb.de \
    --cc=clrrm@isep.ipp.pt \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=insafonov@gmail.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=knv418@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=ojaswin98@gmail.com \
    --cc=ross.schm.dev@gmail.com \
    /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