linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasyl Gomonovych <vgomonovych@marvell.com>
To: <rafael@kernel.org>, <lenb@kernel.org>, <james.morse@arm.com>
Cc: Vasyl Gomonovych <vgomonovych@marvell.com>,
	Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	Randy Dunlap <rdunlap@infradead.org>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	"Robert Richter" <rrichter@amd.com>,
	Tom Saeger <tom.saeger@oracle.com>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] ACPI: APEI: Check NULL argument in exported symbol
Date: Thu, 23 Sep 2021 12:56:10 -0700	[thread overview]
Message-ID: <20210923195612.25949-1-vgomonovych@marvell.com> (raw)

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


             reply	other threads:[~2021-09-23 19:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 19:56 Vasyl Gomonovych [this message]
2021-09-23 20:48 ` [PATCH] ACPI: APEI: Check NULL argument in exported symbol Borislav Petkov
2021-09-23 21:03   ` Borislav Petkov
2021-09-24 15:25 Vasyl Gomonovych
2021-09-24 16:11 ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210923195612.25949-1-vgomonovych@marvell.com \
    --to=vgomonovych@marvell.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rrichter@amd.com \
    --cc=tom.saeger@oracle.com \
    --cc=tony.luck@intel.com \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).