[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1475058758-29877-1-git-send-email-geliangtang@gmail.com>
Date: Wed, 28 Sep 2016 18:32:38 +0800
From: Geliang Tang <geliangtang@...il.com>
To: Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
Kees Cook <keescook@...omium.org>,
Tony Luck <tony.luck@...el.com>
Cc: Geliang Tang <geliangtang@...il.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] ramoops: add pdata NULL check to ramoops_probe
When the pdata is NULL, ramoops_probe() segfaults. So this patch adds
a NULL check to it.
Signed-off-by: Geliang Tang <geliangtang@...il.com>
---
fs/pstore/ram.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 6ad831b..dd9832d 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -576,6 +576,9 @@ static int ramoops_probe(struct platform_device *pdev)
if (cxt->max_dump_cnt)
goto fail_out;
+ if (!pdata)
+ goto fail_out;
+
if (!pdata->mem_size || (!pdata->record_size && !pdata->console_size &&
!pdata->ftrace_size && !pdata->pmsg_size)) {
pr_err("The memory size and the record/console size must be "
--
2.7.4
Powered by blists - more mailing lists