public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] malloc with no return check?
@ 2005-07-18 21:08 Andrew Dyer
  2005-07-19  2:22 ` PATCH: " Travis B. Sawyer
  2005-07-26 18:53 ` [U-Boot-Users] PATCH: au1x00_eth.c (was Re: malloc with no return check?) Andrew Dyer
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Dyer @ 2005-07-18 21:08 UTC (permalink / raw)
  To: u-boot

I noticed the au1xxx ethernet driver has a malloc where the return
value isn't checked.
I did some more looking while waiting for a slow flash programmer and at least
these files seem to do the same thing:

./drivers/ns8382x.c
./drivers/bcm570x.c
./drivers/rtl8139.c
./drivers/eepro100.c
./drivers/dc2114x.c
./drivers/e1000.c
./drivers/sk98lin/skge.c
./drivers/cfb_console.c
./drivers/natsemi.c
./drivers/inca-ip_sw.c
./drivers/rtl8169.c
./drivers/pcnet.c
./cpu/mips/au1x00_eth.c
./cpu/ppc4xx/serial.c
./cpu/ppc4xx/405gp_enet.c
./cpu/ppc4xx/440gx_enet.c
./cpu/i386/serial.c
./cpu/mpc8xx/scc.c
./common/hush.c
./cpu/mpc8xx/spi.c     ?maybe
./cpu/mpc8260/spi.c    ?maybe
./cpu/mpc85xx/ether_fcc.c
./cpu/mpc8260/ether_fcc.c
./cpu/mpc5xxx/fec.c
./cpu/mpc8220/fec.c
./tools/easylogo/easylogo.c

I didn't look under the board directory or check all varieties of alloc :-)  
I will submit patches for the mips stuff hopefully next week.

-- 
Hardware, n.:
        The parts of a computer system that can be kicked.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH:  Re: [U-Boot-Users] malloc with no return check?
  2005-07-18 21:08 [U-Boot-Users] malloc with no return check? Andrew Dyer
@ 2005-07-19  2:22 ` Travis B. Sawyer
  2005-08-15 12:19   ` Wolfgang Denk
  2005-07-26 18:53 ` [U-Boot-Users] PATCH: au1x00_eth.c (was Re: malloc with no return check?) Andrew Dyer
  1 sibling, 1 reply; 5+ messages in thread
From: Travis B. Sawyer @ 2005-07-19  2:22 UTC (permalink / raw)
  To: u-boot

Andrew Dyer wrote:
> I noticed the au1xxx ethernet driver has a malloc where the return
> value isn't checked.
> I did some more looking while waiting for a slow flash programmer and at least
> these files seem to do the same thing:
> 
> ./cpu/ppc4xx/440gx_enet.c
> 

Here's a patch to fix 440gx_enet.c

CHANGELOG
Patch by Travis B. Sawyer, 18 July 2005
Check return value of malloc in 440gx_enet.c

Best regards,

Travis

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 440gx_malloc_fix.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20050718/e960ba8a/attachment.txt 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] PATCH: au1x00_eth.c (was Re: malloc with no return check?)
  2005-07-18 21:08 [U-Boot-Users] malloc with no return check? Andrew Dyer
  2005-07-19  2:22 ` PATCH: " Travis B. Sawyer
@ 2005-07-26 18:53 ` Andrew Dyer
  2006-03-13  0:01   ` Wolfgang Denk
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Dyer @ 2005-07-26 18:53 UTC (permalink / raw)
  To: u-boot

On 7/18/05, Andrew Dyer <amdyer@gmail.com> wrote:
> I noticed the au1xxx ethernet driver has a malloc where the return
> value isn't checked.
> I did some more looking while waiting for a slow flash programmer and at least
> these files seem to do the same thing:
> 

here's a patch for the au1x00_eth.c.  I have a lot of other local changes
to this file (mii support), so I hope my editing the patch won't make it
not apply...

ChangeLog
au1x00_eth.c: check malloc return value and abort if it failed


-- 
Hardware, n.:
        The parts of a computer system that can be kicked.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot-au1x00_eth.c-malloc.diff
Type: text/x-patch
Size: 750 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050726/78b1c4d7/attachment.bin 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH: Re: [U-Boot-Users] malloc with no return check?
  2005-07-19  2:22 ` PATCH: " Travis B. Sawyer
@ 2005-08-15 12:19   ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-08-15 12:19 UTC (permalink / raw)
  To: u-boot

In message <42DC63EF.2020507@sandburst.com> you wrote:
>
> Patch by Travis B. Sawyer, 18 July 2005
> Check return value of malloc in 440gx_enet.c

Added, thanks.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The trouble with doing something right the first time is that nobody
appreciates how difficult it was."                        - Walt West

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] PATCH: au1x00_eth.c (was Re: malloc with no return check?)
  2005-07-26 18:53 ` [U-Boot-Users] PATCH: au1x00_eth.c (was Re: malloc with no return check?) Andrew Dyer
@ 2006-03-13  0:01   ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2006-03-13  0:01 UTC (permalink / raw)
  To: u-boot

In message <c166aa9f050726115354e26978@mail.gmail.com> you wrote:
> 
> ChangeLog
> au1x00_eth.c: check malloc return value and abort if it failed

Applied, thanks. But please stick to the Coding Style (indentation!).

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never put off until tomorrow what you can put off indefinitely.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-13  0:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-18 21:08 [U-Boot-Users] malloc with no return check? Andrew Dyer
2005-07-19  2:22 ` PATCH: " Travis B. Sawyer
2005-08-15 12:19   ` Wolfgang Denk
2005-07-26 18:53 ` [U-Boot-Users] PATCH: au1x00_eth.c (was Re: malloc with no return check?) Andrew Dyer
2006-03-13  0:01   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox