Page MenuHomeFreeBSD

acpi_ibm crashes if smbios information is not exposed by hardware
ClosedPublic

Authored by allanjude on Jun 7 2015, 3:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 12:46 PM
Unknown Object (File)
Mon, Jun 24, 3:37 PM
Unknown Object (File)
Mon, Jun 24, 3:28 PM
Unknown Object (File)
Mon, Jun 24, 3:07 PM
Unknown Object (File)
Mon, Jun 24, 2:04 PM
Unknown Object (File)
Mon, Jun 24, 5:19 AM
Unknown Object (File)
Sun, Jun 23, 11:57 PM
Unknown Object (File)
Sat, Jun 22, 12:15 AM
Subscribers

Details

Summary

Add a check for NULL incase smbios information is not populated

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude retitled this revision from to acpi_ibm crashes if smbios information is not exposed by hardware.
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: rpaulo, emaste, eadler.
ngie added inline comments.
sys/dev/acpi_support/acpi_ibm.c
489–496 ↗(On Diff #6015)

Could you please do this instead to not leak a few bytes of memory (and make the code more readable)?

    /* Enable events by default */
    ...

    /* Enable per-model events */

    if (maker == NULL || product == NULL)
        goto out;

    for (i = 0; i < nitems(acpi_ibm_models); i++) {
        ...
    }

out:
    freeenv(maker);
    freeenv(product);
jhb added inline comments.
sys/dev/acpi_support/acpi_ibm.c
489–496 ↗(On Diff #6015)

The goto probably is more readable, but I don't think that it fixes a leak. The current patch still always calls freeenv() on both strings.

rpaulo edited edge metadata.

Please commit this fix.

This revision is now accepted and ready to land.Jun 11 2015, 2:20 AM
sys/dev/acpi_support/acpi_ibm.c
489–496 ↗(On Diff #6015)

You're right.. I was thinking about an alternative method that isn't in place right now.

This revision was automatically updated to reflect the committed changes.