On Wed, May 14, 2014 at 09:24:03AM -0700, Jordan Justen wrote:
> On Tue, May 13, 2014 at 3:13 PM, Gabriel L. Somlo <gso...@gmail.com> wrote:
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Gabriel Somlo <so...@cmu.edu>
> 
> Can you sync this up with the address the patch is being sent from?

I will try, and apologize in advance if I screw it up. Long, sad story,
involving an unwelcome switch to Exchange of my primary email :)

> > +//
> > +// fw_cfg file names for the SMBIOS entry point and tables
> > +//
> > +#define QEMU_ANCHOR "etc/smbios/smbios-anchor"
> > +#define QEMU_TABLES "etc/smbios/smbios-tables"
> 
> Should we name these FWCFG_FILENAME_FOO and add them to
> OvmfPkg/Include/Library/QemuFwCfgLib.h?

OK.

> > +  SMBIOS_TABLE_ENTRY_POINT QemuAnchor;
> > +  FIRMWARE_CONFIG_ITEM     Anchor, Tables;
> > +  UINTN                    AnchorSz, TablesSz;
> 
> Sz => Size

OK.

> > +  UINT8                    *QemuTables;
> > +
> > +  if (QemuFwCfgFindFile (QEMU_ANCHOR, &Anchor, &AnchorSz) != 
> > RETURN_SUCCESS ||
> 
> EFI_ERROR (QemuFwCfgFindFile (QEMU_ANCHOR, &Anchor, &AnchorSz)

Got it.

> > +/**
> > +  Frees the dynamically allocated portion of the extracted QEMU SMBIOS data
> > +
> > +  @param[in]  QemuTables  Address of QEMU SMBIOS data from 
> > GetQemuSmbiosTables()
> > +
> > +  It is the caller's responsibility to ensure QemuTables was allocated and
> > +  returned from GetQemuSmbiosTables().
> > +
> > + **/
> > +VOID
> > +FreeQemuSmbiosTables (
> > +  IN UINT8 *QemuTables
> > +  )
> > +{
> > +  FreePool (QemuTables);
> > +}
> 
> I don't think we need this function.

Unlike Xen, which just finds the SMBIOS blob in guest memory, I have
to AllocatePool() a buffer for QemuTables in GetQemuSmbiosTables(),
so there's a place to copy stuff from fw_cfg (via QemuFwCfgReadBytes()).

If I don't free it afterwards, won't we end up with a memory leak ?

Thanks,
--Gabriel

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to