ACPI: APEI: Check NULL argument in exported symbol
PATCH 1/1 ACPI: APEI: Check NULL argument in exported symbol
Exported symbol apei_hest_parse is external API
and should check pointer argument
Signed-off-by Vasyl Gomonovych <[email protected]>
--- drivers/acpi/apei/hest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/hest.c +1 -1
@@ -91,7 +91,7 @@ int apei_hest_parse(apei_hest_func_t func, void *data)struct acpi_hest_header *hest_hdr;int i, rc, len; -if (hest_disable || !hest_tab) +if (hest_disable || !hest_tab || !func)return -EINVAL ; hest_hdr = (struct acpi_hest_header *)(hest_tab +1 );
Signature · 1 line
2.17.1
Borislav Petkov
reviewerQuoted 2 lines · Vasyl Gomonovych
Exported symbol
apei_hest_parseis external API
and should check pointer argument
Why?
All users pass a proper, non-NULL function pointer AFAICT.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteBorislav Petkov
reviewerQuoted 7 lines · Borislav Petkov
Quoted 2 lines · Vasyl Gomonovych
Exported symbol
apei_hest_parseis external API
and should check pointer argumentWhy?
All users pass a proper, non-NULL function pointer AFAICT.
Looking at this more, that apei_hest_parse() thng should be made static and the export dropped.
The last user was removed in
708b20003624 ("PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership")
You could mention it in the commit log.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette