Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Pete Popov <ppopov@embeddedalley.com>
To: Josh Green <jgreen@users.sourceforge.net>
Cc: linux-mips@linux-mips.org
Subject: Re: Fixes to drivers/net/au1000_eth.c
Date: Mon, 20 Dec 2004 09:06:14 -0800	[thread overview]
Message-ID: <41C70686.2090806@embeddedalley.com> (raw)
In-Reply-To: <1103511268.15414.15.camel@SillyPuddy.localdomain>

Thanks, I'll take care of the patches.

Pete

Josh Green wrote:
> On Sat, 2004-12-18 at 15:36 -0800, Josh Green wrote:
> 
>>I'm using latest linux-mips CVS kernel (2.6.10rc3) and GCC 3.4.2 on a
>>AMD Alchemy DBau1100 development board (mipsel/MIPS32).  I wasn't able
>>to find any other location to post bugs, so please let me know if there
>>is a bug system or more appropriate place to post this.
> 
> 
> I'm replying to my own post, since I discovered what was causing the
> kernel oops with the au1000_eth.c driver.  The attached patch fixes 3
> problems:
> 
> - The build problem with extern inline str2eaddr.  I just made it
> non-inline, although I'm not sure if this is the best way to resolve the
> issue.
> 
> - At the end of mii_probe(): aup->mii is checked to indicate whether an
> ethernet device was found or not, this variable will actually always be
> set, which leads to a crash when aup->mii->chip_info->name is accessed
> in code following it (in the case where no device is detected).
> aup->mii->chip_info seems like a better test, although I'm not positive
> on that one.
> 
> - In au1000_probe() 'sizeof(dev->dev_addr)' was being used in memcpy
> when copying ethernet MAC addresses.  This size is currently 32 which is
> larger than the 6 byte buffers being used in the copies, leading to
> kernel oopses.
> 
> If I should be sending this to the author of the driver or some other
> location, please let me know. Best regards,
> 	Josh Green
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: arch/mips/au1000/common/prom.c
> ===================================================================
> RCS file: /home/cvs/linux/arch/mips/au1000/common/prom.c,v
> retrieving revision 1.12
> diff -r1.12 prom.c
> 115c115
> < inline void str2eaddr(unsigned char *ea, unsigned char *str)
> ---
> 
>>void str2eaddr(unsigned char *ea, unsigned char *str)
> 
> Index: drivers/net/au1000_eth.c
> ===================================================================
> RCS file: /home/cvs/linux/drivers/net/au1000_eth.c,v
> retrieving revision 1.39
> diff -r1.39 au1000_eth.c
> 100,101c100
> < extern inline void str2eaddr(unsigned char *ea, unsigned char *str);
> < extern inline unsigned char str2hexnum(unsigned char c);
> ---
> 
>>extern void str2eaddr(unsigned char *ea, unsigned char *str);
> 
> 1045c1044
> < 	if (aup->mii == NULL) {
> ---
> 
>>	if (aup->mii->chip_info == NULL) {
> 
> 1497c1496
> < 			memcpy(au1000_mac_addr, ethaddr, sizeof(dev->dev_addr));
> ---
> 
>>			memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
> 
> 1508c1507
> < 						sizeof(dev->dev_addr));
> ---
> 
>>						sizeof(au1000_mac_addr));
> 
> 1513c1512
> < 		memcpy(dev->dev_addr, au1000_mac_addr, sizeof(dev->dev_addr));
> ---
> 
>>		memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
> 
> 1523c1522
> < 		memcpy(dev->dev_addr, au1000_mac_addr, sizeof(dev->dev_addr));
> ---
> 
>>		memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));

      reply	other threads:[~2004-12-20 17:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-18 23:36 Build problem with drivers/net/au1000_eth.c Josh Green
2004-12-20  2:54 ` Fixes to drivers/net/au1000_eth.c Josh Green
2004-12-20 17:06   ` Pete Popov [this message]

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=41C70686.2090806@embeddedalley.com \
    --to=ppopov@embeddedalley.com \
    --cc=jgreen@users.sourceforge.net \
    --cc=linux-mips@linux-mips.org \
    /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