[U-Boot] [PATCH] part_dos: allocate sector buffer dynamically

Wolfgang Denk wd at denx.de
Sat Apr 30 21:14:54 CEST 2011


Dear Sergei Shtylyov,

In message <201104122323.59105.sshtylyov at ru.mvista.com> you wrote:
> Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when it
> tries to read the MBR into 512-byte buffer situated on stack. Instead allocate
> this buffer dynamically to be safe with any large sector size.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov at ru.mvista.com>

Can we please keep the buffer on the stack as before?  There is no
need to use malloc() here. It just makes the code slower and more
complicated and error prone without neeed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Where shall I begin, please your Majesty?" he asked. "Begin  at  the
beginning,"  the  King said, gravely, "and go on till you come to the
end: then stop."    - Alice's Adventures in Wonderland, Lewis Carroll


More information about the U-Boot mailing list