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)
Oct 22 2024, 10:30 PM
Unknown Object (File)
Sep 26 2024, 4:21 PM
Unknown Object (File)
Sep 17 2024, 4:56 AM
Unknown Object (File)
Sep 14 2024, 7:13 PM
Unknown Object (File)
Sep 13 2024, 10:09 PM
Unknown Object (File)
Sep 13 2024, 10:09 PM
Unknown Object (File)
Sep 13 2024, 10:09 PM
Unknown Object (File)
Sep 13 2024, 10:09 PM
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.