lkml.org 
[lkml]   [2021]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ACPI: APEI: Check NULL argument in exported symbol
Date
Exported symbol apei_hest_parse is external API
and should check pointer argument

Signed-off-by: Vasyl Gomonovych <vgomonovych@marvell.com>
---
drivers/acpi/apei/hest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index 277f00b288d1..9f5c334c7c88 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -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);
--
2.17.1
\
 
 \ /
  Last update: 2021-09-23 21:57    [W:0.043 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site