[coreboot] v2: is this a bug ? (in device_util.c)

Stefan Reinauer stepan at coresystems.de
Tue Aug 12 09:32:03 CEST 2008


JasonZhao at viatech.com.cn wrote:
>
> Hardwaremain()-> dev_configure();-> void
> root_dev_read_resources(device_t root) ->
>
> void compact_resources(device_t dev)->
>
> memmove(resource, resource + 1, dev->resources - i); 
>
> The third parameter should be (dev->resources-I)* sizeof(*resource)
>
Dear Jason,

thank you very much for your finding!

It is indeed a bug and should be fixed.

I am surprised we did not hit this before, as this potentially wipes out
whole resource entries. (unless the number of resources is bigger than
the size of a resource in bytes)

But only if there are holes in the resource entries. Not sure why/how
these occur. Eric, your word!


-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866





More information about the coreboot mailing list